Skip to content

Fix cell updates failing with "missing 'pk_col' parameter" - #1

Merged
debba merged 1 commit into
mainfrom
fix/pk-map-crud
Jul 24, 2026
Merged

debba merged 1 commit into
mainfrom
fix/pk-map-crud

Conversation

@debba

@debba debba commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Updating (or deleting) a row from the data grid always failed with:

Update failed: missing 'pk_col' parameter

The plugin read the primary key from the pk_col/pk_val parameters documented in the plugin guide, but the host actually sends a pk_map object (column → value), which also supports composite primary keys (src-tauri/src/plugins/driver.rs in the host).

Same fix as TabularisDB/tabularis-oracle-plugin#2.

Fix

  • update_record and delete_record now read pk_map first and fall back to the documented pk_col/pk_val pair for compatibility.
  • The WHERE clause is built from all key columns with bound parameters; NULL key values compare with IS NULL (a bound = NULL would never match).
  • Composite primary keys now work.

Testing

  • 4 new unit tests covering pk_map (composite), the legacy pk_col/pk_val fallback, NULL key handling, and missing-parameter errors.
  • Full suite passes: 46 tests. Clippy clean.

The host sends the primary key as a pk_map object (column -> value,
supporting composite keys), while the plugin only read the pk_col/pk_val
pair documented in the plugin guide, so every cell update failed with
"missing 'pk_col' parameter". Accept pk_map first and fall back to
pk_col/pk_val; NULL key values compare with IS NULL.
@debba
debba force-pushed the fix/pk-map-crud branch from 040d4f2 to bd7a65d Compare July 24, 2026 13:52
@debba
debba merged commit 15d2c71 into main Jul 24, 2026
@jonaspm
jonaspm deleted the fix/pk-map-crud branch October 27, 2026 06:34
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