-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve movement of tables between different schemata
This improves the Edit Table dialog to better handle moving tables from one schema to another, though the UI currently only knows about the main and the temp schema. This also simplifies the grammar code by removing the temporary flag from all classes because it's redundant now that we support multiple schemata.
- Loading branch information
1 parent
a5ca756
commit 7db96cd
Showing
5 changed files
with
17 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7db96cd
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.
This is working decently so far, testing with simple tables. The automatic movement of associated indexes is good too. 😄
Any idea how we'll it'll handle tables with foreign keys between them? I haven't tried it yet, and I'm way brain faded atm. Probably try it out later tonight. 😄
7db96cd
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.
Good question 😉 I'm not entirely sure what would happen but it probably won't really work. But then there isn't much we can do about it. Foreign keys can reference tables in another schema and moving or copying other tables would be too much. So the question is just how helpful the error message is, that you'll get 😉
7db96cd
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.
Ahhh, didn't realise foreign key references in SQLite could refer to attached databases.
Sounds like that could be really powerful. But yeah... painful for stuff like this. 😉
7db96cd
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.
Oops, I meant to write can't 😉 Sorry for the confusion! If they could, we could just move the table and change all references in the foreign keys. That would keep the databases in a working state as long as they are still attached, allowing the user to take further manual actions. But as I said (or intended to say) we can't do that. So it's definitely going to create some sort of error...
7db96cd
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.
Is this assuming you're only going to have the 'main' schema ... ie, what about attached databases?
7db96cd
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.
Yes, because at this point the Edit Table dialog only had a checkbox which would allow you to toggle between temporary and non-temporary schema. But that has only been an intermediate step to split up the commits into smaller pieces. Here's the next one where support for attached databases was added 😄