Repository navigation
feat(sqlite): pin subqueries, with queries and views by their keys - #106
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No configured credential can serve this run. Your Claude Pro/Max subscription has hit its usage limit, which resets at 2026-10-26 08:00 UTC. Re-trigger after it resets, or add an API key for this provider, which Pullfrog falls back to automatically. The providers' responses
|
4764206 to
52fe137
Compare
|
No configured credential can serve this run. Your Claude Pro/Max subscription has hit its usage limit, which resets at 2026-10-26 08:00 UTC. Re-trigger after it resets, or add an API key for this provider, which Pullfrog falls back to automatically. The providers' responses
|

A subquery, a WITH query or a view is now pinned to one row by a unique key of its rows on SQLite, as a table is by its index.
select * from (select id, title from posts) s where s.id = :idwasmanyand is nowmaybeOne, and so are the WITH and view forms. This is the rule #105 adds on Postgres, over SQLite's resolved tree.The rule
A set of a subquery's output columns is a key of its rows when either:
The outer equalities then pin the subquery by that key under the same checks a table's key gets: a value that reads only pinned items, nothing volatile, no COLLATE, a comparison that leaves the column's values as they are, and a collation the key holds to.
A set operation, VALUES, a key column passed through an expression or a cast, a join to a table that is not pinned, and a RIGHT or FULL JOIN give no key.
SQLite's resolved tree already holds a view as the subquery it is, so views need nothing more.
Checks
oracle/cases/sqlite_subquery_keys: 49 statements, run over seeded edge values with no contradiction.--strict-coverage. One existing answer moves,sqlite_functions/view.sql, a view that passesidthrough, read by it:manytomaybeOne.nub run testwith both test databases: 251 pass, none skipped. The docs state the rule in the SQLite page's cardinality section.