-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Add support for generated table columns #2107
Comments
This adds support for parsing, storing, and generating GENERATED ALWAYS AS columns as added in SQLite 3.31.0. See issue #2107.
This fixes inserting new rows into tables with generated columns by not trying to insert NULL values into these columns. With this change these columns are effectively treated as if they had a default value which means that the Add Record dialog does not need to show by default anymore. See issue #2107.
This disables all cells in generated columns for editing in the Browse Data tab. Since the values of these columns are generated by SQLite there is no way to edit them directly and each attempt will result in an error. So it is best to not allow editing them in the UI. See issue #2107.
👍 I just spent some time figuring out why my DB would not load due to a syntax error, when it's working fine otherwise. How's this issue moving forward? I tried the latest nightly build for Mac OS and it still could not load the DB. Can I help? |
@mnmkng This should work in the latest nightly build and in the release candidate for version 3.12.0 of DB4S. Can you check again? If you still can't open the DB with that this is an issue we should investigate 😄 |
Sorry, I removed the generated columns and replaced them with Node.js side calculations shortly after. So it’s been working fine for some time. 🙂 |
@laqrix Would you be ok to test our recent release candidate, or one of our recent nightly builds, and let us know if this is working for you? |
The release candidate appears to work. My test was not extensive, just attempt to load and browse a database with generated columns. Thanks! |
Awesome, thanks heaps @laqrix. 😄 @MKleusberg Guessing we should add this to the list of v3.12.x improvements? |
@justinclift It's already mentioned in the Enhancements section of the Alpha release notes 😄
|
Cool. Looks like we can close this then. Good work @MKleusberg. 😄 |
Let me reopen this issue for now as there is still some work to do as mentioned in the original issue text 😄 |
Oops. 😉 |
Regarding the third point:
the column value is refreshed when a query act on the column, for example applying a filter. So is it really necessary? I would say that the fourth point:
is really important since by now one can only create or modify a table with a |
There is this new feature called generated columns in SQLite 3.31.0. See here for details. We should add support for this in the future. As far as I can tell these parts of DB4S need to be changed:
The first item is the most important one since it is required for even opening these databases.
The text was updated successfully, but these errors were encountered: