Repository navigation
Feature/edit table generated columns - #4228
Open
deepsidhu1313 wants to merge 5 commits into
Open
deepsidhu1313 wants to merge 5 commits into
deepsidhu1313 wants to merge 5 commits into
Conversation
Add SQL round trip tests for VIRTUAL and STORED generated columns and a test that Field/Table comparison notices changes to the generated column definition (alterTable relies on it to detect modified tables). Add an offscreen test (test-edit-table) which drives the Edit Table dialog against a real database: showing, adding, changing and removing generated columns, switching between VIRTUAL and STORED, adding a STORED column to a table with data, and the primary key / default value restrictions. These fail for now as the dialog has no support for generated columns yet. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Add a "Generated" column to the field list which holds the expression of a generated column (empty for ordinary columns) and a "Stored" checkbox column which switches the column from VIRTUAL, the default, to STORED. Both are filled from the existing table and applied to the field when edited. See sqlitebrowser#2107. Generated columns can't be part of the primary key and can't have a default value, so the dialog refuses these combinations. Turning an existing column into a generated column replaces its data, so the user has to confirm that first. SQLite can't add a STORED column with ALTER TABLE ADD COLUMN, so alterTable() now leaves those to the table rebuild it does anyway. Field::operator== ignored the generated column constraint which made alterTable() believe nothing had changed when only the generated column expression or storage was edited. Compare it by value now. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
test-global-filter needs the CMake prefix paths on PATH on Windows because the CI jobs build SQLite as a DLL there. test-edit-table links SQLite too and would crash on Windows without them. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The .ui files connect to slots that don't exist in Qt6 (QDialog::help) unless uic generates string based connections. The main target already sets this option for Qt6, but test-edit-table compiles the dialogs' .ui files as well and would fail to build with Qt6. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Link CipherDialog into test-edit-table, which sqlitedb.cpp needs when it is built with SQLCipher. Skip the three tests that have the dialog show a message box on Windows, where QMessageBox::showEvent() crashes with the offscreen platform. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add SQL round trip tests for VIRTUAL and STORED generated columns and a
test that Field/Table comparison notices changes to the generated column
definition (alterTable relies on it to detect modified tables).
Add an offscreen test (test-edit-table) which drives the Edit Table
dialog against a real database: showing, adding, changing and removing
generated columns, switching between VIRTUAL and STORED, adding a STORED
column to a table with data, and the primary key / default value
restrictions. These fail for now as the dialog has no support for
generated columns yet.
Co-Authored-By: Claude Sonnet 5.5 noreply@anthropic.com