Repository navigation
Done
Labels
Description
What happened?
On iOS, every engine that runs the Mac plugin (SQLite, DuckDB, ClickHouse, Oracle, Cloudflare D1, MongoDB) maps the plugin's columns through ColumnInfo(from:), which copies neither allowedValues nor a GENERATED ALWAYS identity. Two results:
- ClickHouse
Enum8andEnum16columns get no value completion afterWHERE status =. The Mac offers the labels. - An Oracle
GENERATED ALWAYS AS IDENTITYcolumn reads as writable. Insert Row shows a field for it instead of "Assigned by the database", and a non-key one can be edited in the row detail. Oracle refuses both (ORA-32795, ORA-32796). The Mac treats the column as server-owned.
Steps to reproduce
ClickHouse:
CREATE TABLE t (id UInt32, status Enum8('new' = 1, 'paid' = 2)) ENGINE = MergeTree ORDER BY id- On iPhone or iPad, type
SELECT * FROM t WHERE status =in the query editor. - No values are offered.
Oracle:
CREATE TABLE t (id NUMBER PRIMARY KEY, seq NUMBER GENERATED ALWAYS AS IDENTITY, note VARCHAR2(40))- On iOS, open
Tand a row.SEQis editable. Change it and save: ORA-32796.
Expected behavior
ColumnInfo(from:) carries allowedValues, and identityKind == .always sets rejectsWrittenValues, as the iOS SQL Server driver does for identity columns.
Code path
apple/Packages/TableProCore/Sources/TableProModels/QueryResult.swift:312-325sets neither field.apple/TableProMobile/TableProMobile/Drivers/PluginBackedDriver.swift:239-243maps every plugin column through it.- ClickHouse fills
allowedValuesfrom the Enum type (apple/Plugins/ClickHouseDriverPlugin/ClickHousePluginDriver+Schema.swift:103). The iOS completion fallback only parsesENUM(...)andSET(...)spellings (apple/TableProMobile/TableProMobile/Completion/QueryCompletionCatalog.swift:214-226). - Oracle reports
.always(apple/Plugins/OracleDriverPlugin/OraclePluginValues.swift:42,:57-63). iOS gates edits and inserts onisServerOwned(ViewModels/RowDetailViewModel.swift:228-237,Views/InsertRowView.swift:125,Helpers/RowInserter.swift:72). iOS SQL Server sets it (Drivers/MSSQLDriver.swift:458); the Mac reads.alwaysas server-owned (apple/TablePro/Core/Services/Query/QueryExecutor.swift:420). OracleBackedDriverTests"Identity and virtual columns read as auto-increment and generated" checksisAutoIncrementonly.
Found by reading the code at main, not run on a device.
Database type
ClickHouse, Oracle
TablePro version
main (f67b55a)
Platform
iPhone / iPad (iOS / iPadOS)
Found during the 2026-11-22 perf audit.
Activity
mvanhorn commentedon Nov 25, 2026
ColumnInfo(from:) dropped the enum labels supplied by the plugin. It also mapped both Oracle identity modes to isAutoIncrement, losing the distinction the forms need to tell whether a column accepts an explicit value.
The mapping now copies plugin.allowedValues for query completion and sets rejectsWrittenValues only when identityKind is .always. This lets the forms treat always-identity columns as server-owned while keeping by-default identities writable.
#4494