Search code examples
javasqlpostgresqlquerydsljooq

Parse SQL to sql builder


Is there easy way to convert SQL string like:

SELECT u.name, u.role 
FROM users 
WHERE user_id = ?

to any of SQL builders like JOOQ, QueryDsl just to get ability to modify query — add joins, additional "where" clauses, LIMIT-OFFSET?


Solution

  • Another option, I've used JSQLParser in the past for a project like this. It wasn't very difficult to use.