Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alter table rename #848

Merged
merged 8 commits into from
Apr 12, 2023
Merged

Alter table rename #848

merged 8 commits into from
Apr 12, 2023

Conversation

f0ssel
Copy link
Contributor

@f0ssel f0ssel commented Apr 11, 2023

I think this works, still need to test in dev

closes #809

@f0ssel f0ssel requested review from scsmithr and vrongmeal April 11, 2023 20:02
Copy link
Member

@scsmithr scsmithr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change will be a good thing to test with SLTs.

Something like

statement ok
create schema rename_tables_test;

statement ok
set search_path = rename_tables_test;

statement ok
set enable_debug_datasources to t;

statement ok
create external table t1 from debug options (table_type = 'never_ending');

statement ok
alter table t1 rename to t2;

...

@f0ssel
Copy link
Contributor Author

f0ssel commented Apr 11, 2023

Based on https://github.com/GlareDB/glaredb/actions/runs/4671477670/jobs/8272523797?pr=848, I think I need to update the proto files. @scsmithr is there a command I need to run?

nvm I see you edit the proto files and it generates the code, not the other way around. 👍

@f0ssel
Copy link
Contributor Author

f0ssel commented Apr 11, 2023

Realize I also still need to properly parse the if exists, that's currently just not happening.

Copy link
Contributor

@vrongmeal vrongmeal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 💯

Just the one comment about returning error when removing from entries. @scsmithr how do you feel about that?

@f0ssel
Copy link
Contributor Author

f0ssel commented Apr 12, 2023

@scsmithr it seems that the default alter table parse doesn't seem to give me an if_exists option, so I'd need to do my own parsing similar to here I think - https://github.com/GlareDB/glaredb/blob/f0ssel/alter-table-rename/crates/sqlexec/src/parser.rs#L201 . Maybe we just scrap the if exists option for now?

@f0ssel f0ssel force-pushed the f0ssel/alter-table-rename branch from 45940a2 to b058a96 Compare April 12, 2023 13:38
@f0ssel f0ssel dismissed vrongmeal’s stale review April 12, 2023 13:39

made changes

@scsmithr
Copy link
Member

@scsmithr it seems that the default alter table parse doesn't seem to give me an if_exists option, so I'd need to do my own parsing similar to here I think - https://github.com/GlareDB/glaredb/blob/f0ssel/alter-table-rename/crates/sqlexec/src/parser.rs#L201 . Maybe we just scrap the if exists option for now?

Let's skip and open an issue for it. It should be easy to add to the upstream lib.

@f0ssel f0ssel force-pushed the f0ssel/alter-table-rename branch from c7530e7 to 349fe55 Compare April 12, 2023 13:58
@f0ssel f0ssel merged commit 652fefb into main Apr 12, 2023
@f0ssel f0ssel deleted the f0ssel/alter-table-rename branch April 12, 2023 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add table renaming
3 participants