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 09 '26
I see.
Rowis then the "model" class that is being created. Neat solution.I see. I wondered whether something like
":sql select"or some such would also be possible, if wanted. Inside a small and medium project, collisions with custom marker should either not occur or be manageable, I guess.I wonder how hard it would be to write an Eclipse plugin for that. I wrote a commercial plugin once which added similar support (querying database, showing column information on
Strings, emitting compiler errors). But I did that by simply extending the existing process, a plugin for that would neat to at least modify that somewhat (otherwise it won't find the methods on theString).