Conversation
There was a problem hiding this comment.
Pull request overview
This PR extends the TypeScript type generator to infer structured result types for PostgreSQL JSON/JSONB construction and aggregation functions (instead of falling back to any), updating demo snapshots accordingly.
Changes:
- Add a new
TsFieldType::StructuredObjectvariant and TS formatting for structured object literals. - Add expression translation support for
json_build_object/jsonb_build_objectandjson_agg/jsonb_agg(with limited inference). - Update demo
.queries.ts/ snapshot expectations to reflect structured JSON result types.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/sample/sample.queries.ts | Removes previously committed generated sample query types. |
| tests/demo/select/no-default-table.snapshot.ts | Updates expected JSON build object fields from any to a structured object type. |
| tests/demo/select/no-default-table.queries.ts | Updates expected JSON build object fields from any to a structured object type. |
| tests/demo/postgres/jsonb_operations.snapshot.ts | Updates expected jsonb_build_object / jsonb_agg result types to structured object / array of objects. |
| tests/demo/postgres/jsonb_operations.queries.ts | Updates expected jsonb_build_object / jsonb_agg result types to structured object / array of objects. |
| src/ts_generator/types/ts_query.rs | Introduces TsFieldType::StructuredObject and renders it as a TS object-literal type. |
| src/ts_generator/sql_parser/expressions/translate_expr.rs | Adds inference logic for JSON build + JSON aggregation functions. |
| src/ts_generator/sql_parser/expressions/functions.rs | Adds function-name classification helpers for JSON build/aggregation functions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 42 out of 42 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 41 out of 41 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/ts_generator/sql_parser/expressions/function_handlers/json_functions.rs
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 43 out of 50 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/ts_generator/sql_parser/expressions/function_handlers/json_functions.rs
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 44 out of 51 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.