-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[Import/Export] Exported databases can now be safely moved #5965
Conversation
…that placeholder with the path given to it
Actually, do we even need the placeholder? |
Thanks for the PR! While the placeholder approach is relatively straightforward I do see some potential issues with this:
Perhaps we can use the Parser for this - for example we can run the parser on the |
You mean from new version -> old version Because for old version -> new version this should still work The other points are fair though |
It used to work, so I would prefer not to break it unnecessarily |
I've made some changes to the statement verifier to include the copy statement Though I went a little overboard and implemented Equals for every Statement Found and fixed a few bugs in this ToString that I need to move over to this PR, but other than that it should be done |
} | ||
|
||
string CopyStatement::ToString() const { | ||
string result; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have verification for ToString
round-trips for INSERT/DELETE/SELECT statements in src/main/client_context.cpp:670
(in PendingStatementOrPreparedStatementInternal
). Perhaps add the COPY statement there as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I completely missed that, my mind instantly went to StatementVerifier
so I made changes there to support other types of statements than Select, but that required skipping a lot of the functionality of the StatementVerifier, because we can't execute them - because of side-effects.
So this will definitely be better
Also a good place to add the Equals check I think
Thanks! |
This PR fixes #5868
Previously we would EXPORT and bake the absolute path of the table data into the query e.g
path/to/exported/db/tbl.csv
When we only really need the
tbl.csv
part, because the path of thedb
folder is already provided on IMPORT.Now we prefix the path with a placeholder on EXPORT, and replace it with the
db
folder path on IMPORT.