SQG is a type-safe SQL code generator — you write .sql files with annotated queries, and it generates strongly-typed database access code for TypeScript and Java by introspecting your queries against real database engines at build time.
Here’s what’s new in v0.10.0.
Generated Java code now includes methods that return Stream
try ( Stream < User > users = queries . getAllUsersStream () ) { users . forEach ( user -> process ( user )) ; }
The stream holds a reference to the underlying ResultSet , so it needs to be closed after use — hence the try-with-resources.
Array columns like TEXT[] or INTEGER[] are now handled correctly in generated Java code. Previously these types could produce incorrect mappings — they now resolve to proper List
DuckDB: List types in Appender Section titled “DuckDB: List types in Appender”
The DuckDB appender now supports list/array column types. If your table has a column like tags VARCHAR[] , the generated appender method accepts the corresponding list type and writes it correctly using DuckDB’s bulk insert API.
Upgrade with npm install -g @sqg/[email protected] or update your project’s dependency. Full source on GitHub. Try it out in the playground.
Discuss this on Hackernews.