March 8, 2026
Streams, screams, SQL dreams
SQG (SQL to Code Generator) Now with Java Streams and List Type Support
Devs cheer new speed tricks, argue over “closeable” streams, and ask if it beats SQLDelight
TLDR: SQG now generates Java code that can process database results as a stream and correctly handles list/array columns, including with DuckDB. The crowd loves the memory-friendly upgrade but argues over a confusing “remember to close it” design and whether it rivals SQLDelight or mirrors SQLC’s feel.
SQG just dropped v0.10.0 and the crowd is buzzing. The tool that turns database queries into code now adds Java “streams” alongside regular lists, which means results can be processed on-the-fly instead of loading everything into memory. That’s cool, but the top reaction? Confusion over having to close the stream. One commenter wants a special, obvious type instead of plain Java Streams, saying the current approach feels like a footgun for anyone who forgets to close it. Cue the drama: half the thread nods at the try-with-resources pattern (Java’s auto-close block), the other half groans, “Please don’t make me babysit my data.”
Meanwhile, the comparison wars kick off. A Kotlin fan rolls in asking how SQG stacks up against SQLDelight (a popular Kotlin-first generator), while another voice says it looks a lot like SQLC, adding that the syntax is “almost identical.” Tribal flags raised, popcorn popped. On the practical side, people applaud that array columns (like tags or lists of numbers) now map correctly to normal list types in Java, and DuckDB fans cheer that bulk inserts now handle lists properly with DuckDB’s pipeline (DuckDB). The vibe: great upgrade, sharper edges on the stream design, and a classic internet split between Team Close-Your-Stream and Team Don’t-Make-Me. Bonus memes: “Streams vs Screams” and “Not Another ORM, Please.”
Key Points
- •SQG v0.10.0 introduces Java methods that return Stream<T> alongside List<T> for query results.
- •Stream-returning methods enable lazy evaluation and require closing (e.g., via try-with-resources) because they reference a ResultSet.
- •Generated Java code now correctly maps SQL array columns to appropriate Java List types (e.g., List<String>, List<Integer>).
- •The DuckDB appender gains support for list/array column types, using DuckDB’s bulk insert API for correct writes.
- •The release is available via npm, with full source on GitHub and a playground to try the tool.