Repository navigation
feat(data-grid): edit rows of updatable views keyed on the base table's key - #3961
Merged
Merged
Conversation
…'s key PostgreSQL, MySQL, MariaDB and SQL Server views the server can write through, and that show every primary key column of their one base table, are editable in the grid. Other views stay read-only and the grid says why.
…nned result switch
…ey columns as the key
Signed-off-by: Ngô Quốc Đạt <datlechin@gmail.com>
This was referenced Nov 1, 2026
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.
Summary
fetchViewRowEditing(view:schema:), default nil, so other engines keep views read-only. It answers.editable(PluginViewWriteTarget)(base table, key, read-only columns, base column defaults and identity, allowed operations) or.readOnly(reason). One sharedPluginViewRowEditing.resolvebuilds the target for every engine. Kit 41 has not shipped, so the version stays.pg_relation_is_updatablebits per operation,pg_column_is_updatableper column, the_RETURNtarget list followed through nested views; any rule or INSTEAD OF trigger makes the view read-only.IS_UPDATABLEand the stored definition, tokenized by Unicode scalar, items mapped to view columns by position, nested views followed, the key read fromSTATISTICS(column grants hide part of it fromKEY_COLUMN_USAGE). MySQL inserts only when every view column is a base column; MariaDB inserts past computed columns. TiDB, OceanBase and Databend stay read-only.WITH VIEW_METADATAand INSTEAD OF triggers on the view chain are read-only, browse mode maps columns, compile-only probes decide each operation (4405 on DELETE marks a join, self-joins included), the base key and columns are read in the base table's database.PluginSQLFiltermoved to its own file, soPluginDatabaseDriver.swiftstays under SwiftLint's length limit unsqueezed.Test plan
PluginViewRowEditingTestsandMSSQLViewSourcesTests(swift test);PostgreSQLViewRowEditingTestsandMySQLViewRowEditingTestson fixtures read from live servers.UpdatableViewRowWriteTests: tooltip in a table tab, insert and delete gating, stale keys refused, the base table in the save plan. New cases inResultEditabilityTests,TabObjectKindTests,ParseSchemaMetadataTests,CascadeDeletePlanTests,RewindPlannerTests,RowWriteOperationBuilderTests,RowChangeStatementFactoryCoverageTests.apple/scripts/probes/check-view-row-editing.shbuilds the drivers' own view code, checks each answer and writes through every editable view: PostgreSQL 17 (47 checks), MySQL 8.4 (50), MariaDB 11.8 (50), SQL Server 2022 (47), all passed.Docs: TableProApp/docs#148 (draft, merges after this).
Fixes #3934