Skip to content

Conversation

@gabrieljones
Copy link

@gabrieljones gabrieljones commented Jan 27, 2026

I lack the expertise to judge the quality of this code.

If this is not the right approach, please feel free to close this PR.

I apologize if this is noise.

Original PR comment:

This PR adds support for json and jsonb columns in Postgres dialect using ujson.Value.
It includes a TypeMapper and a set of operators corresponding to Postgres JSON operators.
Tests are added to verify the generated SQL.
Note: Running tests against a real Postgres instance was not possible in the environment, so tests rely on verifying generated SQL strings.
The ? operators are implemented using jsonb_exists functions to avoid conflicts with JDBC parameter placeholders.


PR created automatically by Jules for task 11001438534513701997 started by @gabrieljones

google-labs-jules bot and others added 4 commits January 27, 2026 11:08
- Add `upickle` dependency to `scalasql` module.
- Add `TypeMapper[ujson.Value]` to `PostgresDialect` mapping to `JDBCType.OTHER`.
- Add `ExprJsonOps` to `PostgresDialect` supporting operators `->`, `->>`, `#>`, `#>>`, `@>`, `<@`, `?`, `?|`, `?&`, `||`, `-`.
- Implement `?`, `?|`, `?&` using `jsonb_exists` functions for JDBC safety.
- Add `PostgresJsonTests` verifying SQL generation for all operators.

Co-authored-by: gabrieljones <[email protected]>
- Add `upickle` dependency to `scalasql` module.
- Add `TypeMapper[ujson.Value]` to `PostgresDialect` mapping to `JDBCType.OTHER`.
- Add `ExprJsonOps` to `PostgresDialect` supporting operators `->`, `->>`, `#>`, `#>>`, `@>`, `<@`, `?`, `?|`, `?&`, `||`, `-`.
- Implement `?`, `?|`, `?&` using `jsonb_exists` functions for JDBC safety.
- Add `PostgresJsonTests` verifying SQL generation for all operators.
- Add `PostgresJsonExample` demonstrating usage with Testcontainers.

Co-authored-by: gabrieljones <[email protected]>
- Add `upickle` dependency to `scalasql` module.
- Add `TypeMapper[ujson.Value]` to `PostgresDialect` mapping to `JDBCType.OTHER`.
- Add `ExprJsonOps` to `PostgresDialect` supporting operators `->`, `->>`, `#>`, `#>>`, `@>`, `<@`, `?`, `?|`, `?&`, `||`, `-`.
- Implement `?`, `?|`, `?&` using `jsonb_exists` functions for JDBC safety.
- Add `PostgresJsonTests` verifying SQL generation for all operators.
- Add `PostgresJsonExample` demonstrating usage with Testcontainers.
- Apply Scalafmt formatting.

Co-authored-by: gabrieljones <[email protected]>
- Add `upickle` dependency to `scalasql` module.
- Add `TypeMapper[ujson.Value]` to `PostgresDialect` mapping to `JDBCType.OTHER`.
- Add `ExprJsonOps` to `PostgresDialect` supporting operators `->`, `->>`, `#>`, `#>>`, `@>`, `<@`, `?`, `?|`, `?&`, `||`, `-`.
- Implement `?`, `?|`, `?&` using `jsonb_exists` functions for JDBC safety.
- Add `UjsonQueryable` implicit to `PostgresDialect` to support `Expr[ujson.Value]` in queries.
- Add `PostgresJsonTests` verifying SQL generation for all operators.
- Add `PostgresJsonExample` demonstrating usage with Testcontainers.
- Apply Scalafmt formatting.

Co-authored-by: gabrieljones <[email protected]>
@gabrieljones gabrieljones changed the title Add postgres json support 11001438534513701997 Add postgres json support Jan 27, 2026
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.

1 participant