Add computed select projections#22
Conversation
Document query, IR, and SQLite planning contracts for query-local computed select projections. Assisted-by: Codex:gpt-5.5
Capture the token contract for the := shape assignment syntax before implementing lexer support. Assisted-by: Codex:gpt-5.5
Add a dedicated query lexer token for := so computed shape items can be distinguished from nested shape syntax. Assisted-by: Codex:gpt-5.5
Capture the AST contract for query-local computed projection items before adding parser support. Assisted-by: Codex:gpt-5.5
Add a query-local computed shape item variant while preserving the existing schema-backed shape item constructor. Assisted-by: Codex:gpt-5.5
Capture parsing for alias-assigned arithmetic projections in select shapes. Assisted-by: Codex:gpt-5.5
Teach select shape parsing to build computed AST items from alias-assigned expressions while preserving nested shape parsing. Assisted-by: Codex:gpt-5.5
Capture the Semantic IR contract for query-local computed projection items without schema field references. Assisted-by: Codex:gpt-5.5
Add resolved shape item variants so schema-backed fields and computed projection values keep separate IR invariants. Assisted-by: Codex:gpt-5.5
Capture resolution from computed AST shape items to query-local computed IR shape items. Assisted-by: Codex:gpt-5.5
Map computed AST shape items to computed Semantic IR items without treating them as schema-backed fields. Assisted-by: Codex:gpt-5.5
Cover unsupported computed projection value forms and duplicate output names at semantic resolution. Assisted-by: Codex:gpt-5.5
Reject unsupported computed projection forms and duplicate shape output names during semantic resolution. Assisted-by: Codex:gpt-5.5
Capture planning for computed select projection values before extending selected value slots. Assisted-by: Codex:gpt-5.5
Lower computed shape items to SQLite value expressions while preserving schema-backed field projection behavior. Assisted-by: Codex:gpt-5.5
Capture SELECT-list rendering and bind ordering for computed projection value expressions. Assisted-by: Codex:gpt-5.5
Render SELECT-list value expressions with aliases for computed projections while preserving bind ordering. Assisted-by: Codex:gpt-5.5
Add render and execution coverage for computed select projections from query text through SQLite execution. Assisted-by: Codex:gpt-5.5
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 02cd7f205b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Specify that computed projection paths are resolved and planned relative to the shape that contains them. Assisted-by: Codex:gpt-5.5
Use a timestamp-counter suffix instead of mixing both values into one integer for pipeline test schema files. Assisted-by: Codex:gpt-5.5
Pass the containing shape alias into SQLite value planning and prefix nested path traversal aliases to avoid collisions. Assisted-by: Codex:gpt-5.5
Configure SonarCloud CPD exclusions for Rust crate-local test modules. Assisted-by: Codex:gpt-5.5
|
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7a49ed6e80
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Narrow the Semantic IR non-goal to schema-level computed fields so query-local computed projections remain in scope. Assisted-by: Codex:gpt-5.5
Represent field-backed and computed selected values with typed variants and fallible schema-backed accessors. Assisted-by: Codex:gpt-5.5
Use stable generated SQL aliases for computed select values while preserving logical output names in result shapes. Assisted-by: Codex:gpt-5.5
|
@codex reivew |
|
To use Codex here, create an environment for this repo. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7a49ed6e80
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Assign planner-owned aliases to nested path traversal joins and preserve left joins under optional nested sources. Assisted-by: Codex:gpt-5.5
Treat computed division and modulo as nullable unless the divisor is a non-zero numeric literal. Assisted-by: Codex:gpt-5.5
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bd8a2f7462
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Reserve computed SQL aliases against selected field columns and reuse generated join aliases for repeated nested path traversals. Assisted-by: Codex:gpt-5.5
|
@codex review |
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Split resolved path lowering into focused helpers so alias, join cardinality, and scalar column handling are no longer concentrated in one function. Assisted-by: Codex:gpt-5.5
|



Summary
Add computed select projections with
alias := exprsyntax for numeric arithmetic value expressions.Closes #13
Scope
spec/query.md,spec/ir.md, andspec/sqlite-query-plan.md.:=tokenization and parser support for computed shape items.Spec and plan alignment
List the
spec/andplan/files checked for this change. If the changeintentionally diverges from them, explain why and include the required document
update in this pull request.
spec/query.mdspec/ir.mdspec/sqlite-query-plan.mdTests
List the automated and manual checks performed.
cargo test --workspacequery-ir,query-resolver,sqlite-query-plan,sqlite-query-sqlgen, andquery-pipeline-tests).Review notes
Call out API boundaries, temporary rules, migration concerns, or follow-up work
that reviewers should inspect closely.
ResolvedShapeItemnow separates schema-backed fields from computed fields.ResolvedShapeField::field()remains schema-backed only.ResolvedShape::fields()is currently a compatibility view over schema-backed fields. New result-shape code should preferitems().AI assistance
Disclose AI tool usage according to
AI_POLICY.md.messages with
Assisted-bytrailers.Tools and models: