feat: support explicit emits for passthrough relations - #193
Conversation
ae3d5f9 to
2e3e615
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2e3e615e64
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
0f8f140 to
5e14c7c
Compare
5e14c7c to
b146a39
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b146a39153
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| for (position, &index) in self.0.iter().enumerate() { | ||
| if position > 0 { | ||
| write!(w, ", ")?; | ||
| } | ||
| write!(w, "{}", ctx.display(&Value::Reference(index)))?; |
There was a problem hiding this comment.
Validate explicit emit mappings before writing references
When show_emit/OutputOptions::verbose() is used on a Filter/Sort/Fetch/Set/Cross protobuf whose RelCommon.Emit contains an out-of-range or negative index, this explicit path writes $N directly and records no FormatError; the compact Emitted path still checks the index against the direct output, so the same malformed input can silently produce invalid text only in the new explicit output mode. Please make this path perform the same bounds check while still best-effort formatting.
AGENTS.md reference: AGENTS.md:L57-L58
Useful? React with 👍 / 👎.
This PR adds compact and explicit output syntax for pass-through relations:
Filter,Sort,Fetch,Set, andCross.For example, a Filter with an explicit output mapping can be written as:
Compact formatting remains the default.
OutputOptions::show_emitandOutputOptions::verbose()select explicit formatting, preserving an explicit identityEmitmapping rather than normalizing it toDirect.Part of #34.
Changes
=>compact output and|>explicit output parsing for pass-through relations, including empty mappings written as_.Direct, with compact=>output by default and explicit|>output when requested.OutputOptions::show_emitas the public formatting option for explicit relation output.OutputAdditionsfor+>,OutputMappingfor|>,Emittedfor compact final output, andOutputClausefor their composition.Read[table +> _]; retain the previous blank spelling as accepted input for now.API Impact
OutputOptionsnow exposesshow_emit: bool.OutputOptions::verbose()setsshow_emittotrue.Validation
just testjust check