Skip to content

Add support for generated table columns #2107

Open

Description

@MKleusberg

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:

  • Parser and SQL object representation classes
  • Disable writing to these columns in the Browse Data tab
  • Automatically refresh contents of generated columns when other columns are changed in the Browse Data tab
  • Add support for this in the Edit Table dialog

The first item is the most important one since it is required for even opening these databases.

Activity

  1. self-assigned this
    on Jan 30, 2020
  2. mnmkng commented on Mar 26, 2020

    @mnmkng

    👍 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?

  3. MKleusberg commented on Jun 10, 2020

    @MKleusberg
    MemberAuthor

    @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 😄

  4. mnmkng commented on Jun 11, 2020

    @mnmkng

    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. 🙂

  5. justinclift commented on Jun 11, 2020

    @justinclift
    Member

    @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?

  6. laqrix commented on Jun 11, 2020

    @laqrix

    The release candidate appears to work. My test was not extensive, just attempt to load and browse a database with generated columns. Thanks!

  7. justinclift commented on Jun 11, 2020

    @justinclift
    Member

    Awesome, thanks heaps @laqrix. 😄

    @MKleusberg Guessing we should add this to the list of v3.12.x improvements?

  8. MKleusberg commented on Jun 12, 2020

    @MKleusberg
    MemberAuthor

    @justinclift It's already mentioned in the Enhancements section of the Alpha release notes 😄

    Add support for parsing, browsing, and editing tables with GENERATED ALWAYS AS columns (#2107)

  9. justinclift commented on Jun 12, 2020

    @justinclift
    Member

    Cool. Looks like we can close this then. Good work @MKleusberg. 😄

  10. MKleusberg commented on Jun 12, 2020

    @MKleusberg
    MemberAuthor

    Let me reopen this issue for now as there is still some work to do as mentioned in the original issue text 😄

  11. justinclift commented on Jun 12, 2020

    @justinclift
    Member

    Oops. 😉

  12. mate377 commented on Aug 29, 2020

    @mate377

    Regarding the third point:

    • Automatically refresh contents of generated columns when other columns are changed in the Browse Data tab

    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:

    • Add support for this in the Edit Table dialog

    is really important since by now one can only create or modify a table with a GENERATED column through issuing a SQL statement. An Idea to implement this in the editor would be to add a column in the edit dialog called "generated" which adds a GENERATED columns set automatically as VIRTUAL, and a checkbox which allows to change it from VIRTUAL to STORED.

  13. lilygthb commented on Sep 10, 2026

    @lilygthb

    is there any news regarding the support of generated column via the GUI?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions