Skip to content

Support JSON functions#261

Merged
JasonShin merged 19 commits intomainfrom
support-json
Mar 10, 2026
Merged

Support JSON functions#261
JasonShin merged 19 commits intomainfrom
support-json

Conversation

@JasonShin
Copy link
Owner

No description provided.

Copilot AI review requested due to automatic review settings March 4, 2026 11:36
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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::StructuredObject variant and TS formatting for structured object literals.
  • Add expression translation support for json_build_object/jsonb_build_object and json_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.

Copilot AI review requested due to automatic review settings March 6, 2026 12:06
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot AI review requested due to automatic review settings March 6, 2026 12:18
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot AI review requested due to automatic review settings March 10, 2026 04:50
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot AI review requested due to automatic review settings March 10, 2026 05:58
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@JasonShin JasonShin merged commit b2ed603 into main Mar 10, 2026
33 checks passed
@JasonShin JasonShin deleted the support-json branch March 10, 2026 06:16
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