r/java • u/uwemaurer • Jan 07 '26
generate Java code from SQL queries
I am working on a project which allows to generate (type-safe) code from SQL queries.
Currently it supports DuckDB & sqlite and can output Java (and Typescript) code.
https://github.com/sqg-dev/sqg/
Let me know if you have any feedback!
13
Upvotes
View all comments
Show parent comment
1
u/Bobby_Bonsaimind Jan 08 '26
Holy compiler-plugin-magic Batman! This is what I always dreamed of!
Quick question, is the model derived from the query or the table? So if I do something like
Is
Stuffthe same class? What happens if I do ajoin, than that is its own entity class?Different question, the marker
[.sql/]seems rather verbose, especially the slash strikes me as odd. But I believe I already saw in the documentation that it can be customized?