Skip to content

feat(ios): export and import data on iPhone and iPad - #4302

Merged
datlechin merged 13 commits into
mainfrom
feat/ios-data-import-export
Nov 16, 2026
Merged

datlechin merged 13 commits into
mainfrom
feat/ios-data-import-export

Conversation

@datlechin

Copy link
Copy Markdown
Member

Summary

  • iOS: export to a file and share it: a table (filter and sort kept), a query result, selected rows, or several objects up to the whole database (routines, triggers, types, events, sequences, grants, as on macOS). Formats: CSV, JSON, SQL (gzip optional), XLSX, Markdown, MQL.
  • iOS: import CSV, JSON or XLSX into an existing table (Insert, Update, Insert or Update, Insert Skip Existing) or into a new table made from the file; run a .sql file, gzip and PostgreSQL COPY FROM STDIN included.
  • iOS: an export reads on a connection of its own. While a transaction is open on the window, selected rows go out as shown, and an export that read elsewhere warns that it left out the transaction's changes.
  • iOS: an import holds its connection alone: it starts only when nothing else runs there, and other work on that connection is refused until it ends.
  • iOS: open .csv, .tsv, .json, .xlsx and .sql from other apps into the import flow (Viewer, Alternate rank; org.iso.sql imported as on macOS).
  • iOS: Select mode in the data browser and query results, with Export, Copy and Delete for the selection.
  • iOS: an export or import keeps running in the background: BGContinuedProcessingTask on iOS 26, background time before; a stop or expiry rolls back what the import owns.
  • iOS runs the macOS format plugins: the ten plugin folders compile into the app (*OptionsView.swift stays macOS, iOS has its own forms over the same settings).
  • One home per fact: per-engine export catalogs and CREATE TABLE writers moved out of extension <Engine>PluginDriver into shared plugin files both apps compile; the import write path moved to TablePro/Core/Transfer/Shared; the SQL file parser moved to the new TableProSQLFile target; SQLTokenCursor to TableProSQLGrammar; ByteOrderMark to TableProTabularIO.
  • SQL export compresses with zlib in process (GzipDeflater in TableProGzip) instead of spawning /usr/bin/gzip.
  • PluginKit: additive generateDropRelationSQL(name:kind:schema:); kit 45, minimum 19.
  • Fixed on macOS:
    • Markdown export cut emoji and dropped combining marks in aligned columns.
    • XLSX export dropped leading and trailing spaces in text cells (xml:space="preserve").
    • Stop after the last row of an XLSX or Markdown export still saved the file.
    • SQL export with Drop wrote DROP ROUTINE, which no engine accepts, and dropped a PostgreSQL procedure as a function; each engine now writes its own routine drop (SQL Server CLR aggregates DROP AGGREGATE, DuckDB table macros DROP MACRO TABLE).
    • Oracle triggers never reached a SQL export; Oracle drops before 23ai are guarded PL/SQL blocks.
    • Cassandra and Teradata trigger drops in a SQL export used a form those engines reject.
    • CSV, JSON and XLSX import was offered for MongoDB and failed at the first batch.
    • A small SQL file whose only non-UTF-8 bytes sat in its last few bytes was previewed as UTF-8.
  • Fixed on iOS:
    • Copy as SQL INSERT quoted MySQL BIT values and listed generated and identity columns.
    • Copy as JSON typed values differently from macOS.
    • PostgreSQL booleans showed as t/f.
    • MySQL foreign keys used an information_schema join some proxies answer with no rows.
    • Insert Row with only defaults did nothing on Oracle.
    • SQL Server read an empty schema as a schema named "".
  • Behavior that changes beside the feature: Compare & Sync MySQL routine drops gain IF EXISTS; Oracle Drop Trigger in the sidebar and Compare writes the guarded form before 23ai; routine signatures show AGGREGATE (SQL Server CLR) and AS TABLE (DuckDB table macro).
  • Tests changed on purpose: SQLExportBatchSeparatorTests.everyStatementIsItsOwnBatch (no routine drop batch), MySQLSessionScopeTests.creationScopeNeedsRecordedMode, MSSQLDropStatementsTests (signature), fileCutInsideItsLastCharacter, otherEnginesLeftAlone, ClipboardExporterFidelityTests.declaredTypePicksTheJSONType, SQLBuilderDefaultValuesTests.oracleHasNoForm (now oracleNamesAColumn), RowInsertPlannerTests.allDefaultsOnOracle, MySQLForeignKeyCatalogTests, MobileImportDataSinkTests (hex and boolean cases).

Test plan

  • New tests: format plugin defects (ExportStopAndStatusTests, Markdown widths, XLSX whitespace, drop clauses), shared import statements and row writer, engine catalogs with recorded runners, drop statements per engine, gzip round trips against /usr/bin/gzip, the moved parser suites, iOS drivers (SQLite and DuckDB end to end: binds, bytes, catalogs, WAL reader, snapshot), export runner, import sink in all four modes, SQL source, background run fallback, Select mode, scene intents.
  • iOS: 2,641 tests pass on the simulator (verify.sh ios), build and lint PASS.
  • macOS Unit plan: 31,795 of 31,797 pass; the 2 left are FSEvents timeouts (FileSystemEventWatcherTests.onlyALiveWatcherIsCalled, ThemeCatalogTests.picksUpChangesInItsFolder) that time out on this machine; this branch does not touch them.
  • Packages 5,737 + 507 pass; plugins build and all 48 load; verify.sh abi PASS at kit 45; l10n PASS.
  • Not run: the MSSQL probe scripts, which need a SQL Server.

Needs the maintainer

  • Publish the registry plugins this PR changes so their macOS fixes reach users: Cassandra, DuckDB, MongoDB, MSSQL, Oracle, Teradata.

Screenshots

Light Dark
Table More menu Export menu light Export menu dark
Export sheet Export sheet light Export sheet dark
Select mode Select mode light Select mode dark
Table list More menu Database menu light Database menu dark

Before: these menus had no Export, Import, Select Rows or Run SQL File items.

…export

# Conflicts:
#	apple/Packages/TableProCore/Tests/TableProMSSQLCoreTests/MSSQLSchemaQueriesTests.swift
#	apple/Plugins/DuckDBDriverPlugin/DuckDBPlugin.swift
#	apple/Plugins/OracleDriverPlugin/OraclePlugin.swift
#	apple/Plugins/PostgreSQLDriverPlugin/PostgreSQLPluginDriver.swift
…after a SQL file, and keep NUL in SQLite dumps
…atabase, and read each transaction end in a SQL file
…n's settings, and export results from the buffer once the session changed
…use to one sheet, and export shown rows during a transaction

Reverts the session read for selected rows (acba326): a dedicated connection reads every export, and a warning names a transaction it could not see.
…talog connection for database changes in a SQL file, and export views
…olumns in filtered exports, and report joined transactions and failed rows as they ended
@datlechin
datlechin merged commit 7f53514 into main Nov 16, 2026
25 of 27 checks passed
@datlechin
datlechin deleted the feat/ios-data-import-export branch November 16, 2026 23:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant