Skip to content

Only selected cells should be included in Copy as... SQL statement(s) #1929

Closed

Description

@alekwo

What happened?

When I select one or multiple cells (ctrl/cmd+click) with the "standard" Copy function, only the selected cell values are copied, which is as it should be.

However, when using Copy as... > INSERT Statement(s) or UPDATE Statement(s), all columns from the rows in which I made the selection are included in those SQL statements, instead of only the selected cell values.

Steps to reproduce

  1. Open the data view of a table with multiple columns
  2. Select one or several cells (using Cmd/Ctrl+clisk for multiple selection)
  3. Right-click, then select Copy as... > INSERT Statement(s) or UPDATE Statement(s)
  4. The generated statements will contain values from all columns, instead of only those selected

Expected behavior

When I have a table like:

column_a column_b column_c column_d
val_1.a val_1.b val_1.c val_1.d
val_2.a val_2.b val_2.c val_2.d
val_3.a val_3.b val_3.c val_3.d

If I select only val_2.c and val_2.d and use Copy as... > INSERT Statement(s)
Currently, I'd get:

INSERT INTO `myTable` (`column_a`, `column_b`, `column_c`, `column_d`) VALUES ("val_2.a", "val_2.b", "val_2.c","val_2.d");

This should be:

INSERT INTO `myTable` (`column_c`, `column_d`) VALUES ("val_2.c","val_2.d");

Database type

SQLite

TablePro version

0.58.0 (110)

macOS version & chip

26.5.2 (25F84) / M3 Pro

Screenshots / Logs

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions