Skip to content

[Rust] Primary keys for query builder views#4572

Open
joshua-spacetime wants to merge 4 commits intomasterfrom
joshua/rust/transfer-pk-to-view
Open

[Rust] Primary keys for query builder views#4572
joshua-spacetime wants to merge 4 commits intomasterfrom
joshua/rust/transfer-pk-to-view

Conversation

@joshua-spacetime
Copy link
Collaborator

Description of Changes

Query builder views return a subset of rows from a physical table. If that table has a primary key, then so should the view. What this means concretely is that the view should expose the same api as the table, specifically as it relates to the primary key column.

With that in mind, this patch commits the following changes:

  1. Annotates ViewDef with a primary_key
  2. Updates the return type of query builder views in the raw module def to a special product type
  3. Adds an index for the primary key on the view's backing table
  4. Updates the query planner to use this index
  5. Updates rust client codegen to generate on_update for such views

API and ABI breaking changes

None

Expected complexity level and risk

3

Testing

  • New rust sdk integration suite exercising on_update for PK views and semijoin scenarios
  • Smoketests for PK views and semijoin scenarios

@joshua-spacetime joshua-spacetime force-pushed the joshua/rust/transfer-pk-to-view branch from d4a6819 to ab19a38 Compare March 6, 2026 03:24
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