Skip to content

feat(napi): expose named query parameters (param_named) on ExecuteOptions - #98

Closed
msrathore-db wants to merge 1 commit into
msrathore/krn-napi-typedvalue-codecfrom
msrathore/krn-napi-named-params
Closed

msrathore-db wants to merge 1 commit into
msrathore/krn-napi-typedvalue-codecfrom
msrathore/krn-napi-named-params

Conversation

@msrathore-db

Copy link
Copy Markdown
Collaborator

What

Adds named query parameters to the napi ExecuteOptions, completing param parity alongside #84's positional codec:

  • namedParams: Array<{ name, sqlType, value? }> (new NamedTypedValueInput), decoded through the same parse_typed_value codec as positional, then bound via StatementSpec::param_named.
  • Positional + named are mutually exclusive at the SQL level (? vs :name); the node adapter enforces it, the kernel binds whichever is present.

Why

Named binding is actually the SEA-spec-required public param form — the canonical SEA proto marks StatementParameter.name as openapi_required=true (positional is PUBLIC_UNDOCUMENTED). #84 shipped positional-only and flagged named as a follow-on; this is that follow-on. The kernel (StatementSpec.named_params / param_named / named_typed_value_to_sea_parameter) and the SEA wire already fully support it — this only adds the napi surface.

Stack / consumers

Stacked on #84. Consumed by databricks-sql-nodejs#403 (SeaSessionBackend forwards namedParameters → namedParams). Verified live: named INT/STRING/DECIMAL/multi-param bind correctly; mixing positional+named is rejected.

Tests

cargo build / fmt / clippy -D warnings clean; 56 napi tests pass.

This pull request and its description were written by Isaac.

…ions

Adds namedParams (Array<{name, sqlType, value?}>) alongside positionalParams,
decoded via the same parse_typed_value codec and bound with
StatementSpec::param_named. Named is the SEA-spec-required public param form
(StatementParameter.name is openapi_required); positional is the
documented-undocumented variant.

Co-authored-by: Isaac
Signed-off-by: Madhavendra Rathore <madhavendra.rathore@databricks.com>
@msrathore-db

Copy link
Copy Markdown
Collaborator Author

Closing as superseded by #101, which is now the main-based kernel SEA parity mega PR for agent review. The branch is preserved and this can be reopened if we decide to return to smaller stacked reviews.

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