Skip to content

Enable simplified arguments for views - #6324

Merged
JasonAtClockwork merged 30 commits into
masterfrom
jlarabie/view-args-lite
Oct 19, 2026
Merged

JasonAtClockwork merged 30 commits into
masterfrom
jlarabie/view-args-lite

Conversation

@JasonAtClockwork

@JasonAtClockwork JasonAtClockwork commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Description of Changes

Views can now take arguments, called from SQL as SELECT * FROM my_view(1, 'a').

Limitation: a view with arguments can only be queried with SELECT *. Filters, column lists, and joins on it are rejected. Views without arguments and tables are unchanged. Primary keys, currently, create caching issues and are rejected. Floats are also rejected for now.

  • Rust, TypeScript and C# modules can declare view arguments
  • Rust clients have a typed query builder for view calls; TypeScript and C# clients use raw SQL for now
  • Subscribe-all skips views with arguments in every client

This is a reduced version of the view args draft (#6015). Filtering, joins and typed TypeScript/C# client builders are left for follow-ups.

API and ABI breaking changes

None

Rollback safety impact

n/a

Expected complexity level and risk

3 - Tried to keep this as light as possible but it expands view instances to be keyed by the arguments, but with no column list (SELECT * only) the query side should be one index lookup per call.

Testing

  • Unit tests and smoketests for Rust, C# and TypeScript modules
  • Throwaway e2e with Rust, TypeScript and C# modules and clients

@joshua-spacetime

Copy link
Copy Markdown
Collaborator

I would make a couple simplifications related to primary keys:

  1. I would explicitly disallow primary-key declarations for parameterized views.
  2. I would skip automatic primary-key inference for query builder parameterized views.

@JasonAtClockwork
JasonAtClockwork marked this pull request as ready for review October 18, 2026 16:19
@joshua-spacetime

Copy link
Copy Markdown
Collaborator

@JasonAtClockwork we should also filter out parameterized views from SELECT * FROM *

pub(crate) fn get_all<T, F, I>(

Comment thread crates/bindings-csharp/Codegen/Module.cs Outdated
@JasonAtClockwork

Copy link
Copy Markdown
Contributor Author

@JasonAtClockwork we should also filter out parameterized views from SELECT * FROM *

pub(crate) fn get_all<T, F, I>(

Yes this was a miss and has been fixed in 4348c8c

@JasonAtClockwork
JasonAtClockwork added this pull request to the merge queue Oct 19, 2026
Merged via the queue into master with commit 08e1aba Oct 19, 2026
124 of 127 checks passed
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.

2 participants