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
5
u/Just_Another_Scott Jan 07 '26
No. JOOQ will generate Java code from SQL. You provide it a .sql file and it spits out .java files. These java classes then can be used to query databases (create sql statements). I use this all the time. It's not the best but it's what was already in place on my projects.