Skip to content

feat(linux-grid): copy rows as a text table, JSON Lines, one row or INSERT without generated keys - #3862

Merged
datlechin merged 4 commits into
TableProApp:mainfrom
sedax90:feat/linux-copy-as-formats
Oct 28, 2026
Merged

datlechin merged 4 commits into
TableProApp:mainfrom
sedax90:feat/linux-copy-as-formats

Conversation

@sedax90

@sedax90 sedax90 commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Copy As in the Linux grid adds Text Table, JSON Lines, One Row and INSERT Without Generated Keys.
  • Text Table: drawn by comfy-table (already in the lock through DuckDB), bordered as psql draws it. Numbers align right by the grid's own rule, a line break in a cell starts a continuation line, a tab expands to 8-column stops, other control characters and bidi controls show as escapes. A table past 64 MiB is refused with a toast.
  • JSON Lines: one object per line, each line ending in a newline as jsonlines.org specifies. A JSON value stored over several lines stays on its row.
  • One Row: the values as SQL literals of the connection's engine, separated by , , as IN Clause writes them. Offered only where the engine speaks SQL.
  • INSERT Without Generated Keys leaves out what the server gives a new row: a numbered column, or a table's only key column whose default is an expression, such as a UUID. Paste into the grid uses the same rule. Offered only when such a column is on screen.
  • Copy As INSERT and SQL export now write a numbered column the way the engine accepts it: PostgreSQL 10 and later adds OVERRIDING SYSTEM VALUE, SQL Server wraps the statements in SET IDENTITY_INSERT ... ON/OFF, the OFF in a GO batch of its own so a run that fails partway still ends it. Before, GENERATED ALWAYS and IDENTITY columns refused the rows.
  • SQL Server reads a system-versioned table's period columns as generated, so a copied row leaves them to the server.
  • SQLite treats every INTEGER PRIMARY KEY rowid alias as numbered, a default or not: SQLite 3.54 numbers INTEGER PRIMARY KEY DEFAULT 5 from 1.
  • Copy As is grouped into rows and CSV, structured text, SQL, and the column name.

Test plan

  • metadata::integer_primary_key_with_default_still_numbers_itself replaces integer_primary_key_with_default_is_not_auto_increment: the old test pinned the opposite of what SQLite does.
  • identity_insert integration tests on PostgreSQL 18 and SQL Server 2022 run the copied INSERTs against identity, serial and system-versioned tables, and a SQL Server copy that fails on a duplicate key under XACT_ABORT ON.
  • verify.sh --platform linux test: tablepro-core 835, sqlite 256, mssql 132, postgres 118 passed; the app's clipboard, data_grid, export, browse_tab and paste tests all passed.
  • verify.sh --platform linux lint and l10n: clean.
  • Copy As before (main) and after, light and dark, and the Text Table copy pasted into the editor:

Before, light
After, light
Before, dark
After, dark
Text Table pasted

@datlechin
datlechin merged commit dcbce8a into TableProApp:main Oct 28, 2026
43 of 44 checks passed
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.

2 participants