FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix(postgres): SQL result-grid Save must use PK and column types (or stay read-only) · Issue #786 · QueryaHub/Querya-Desktop · GitHub

fix(postgres): SQL result-grid Save must use PK and column types (or stay read-only) #786

Description

Summary

postgres_sql_workspace._applyStagedChanges calls generateMutationPlan() without primaryKeys or columnDataTypes. TableMutationEngine then builds WHERE from every displayed column. SqlTableTargetExtractor skips JOIN but not FROM a, b — UPDATE hits the first table with join-shaped values. If extract fails, the table name is the literal table.

Same execute path as Table Browser (toTransactionSql() in one execute).

Scope

  • Resolve target via getTableSchema (schema + table from a simple FROM). If no PK or the query is not a single-table SELECT, disable Save (same as custom SQL on Table Browser).
  • Pass columnDataTypes into the plan.
  • Reject comma-from / subquery / VALUES as mutation targets.
  • Widget/unit tests: JOIN and FROM a, b do not produce DML; simple SELECT * FROM public.t uses the PK.

Out of scope

  • Table Browser PK path (already wired; still blocked by the multi-statement execute issue).
  • SQLite/MySQL result-grid Save (same class of bug — mention in PR if the helper is shared).

Activity

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

    backendBackend database driver execution and queriesbugSomething isn't workingdata-gridInteractive data grid, cell editor, filtering, groupingseditorCode/SQL editor

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL