Arjan van Wieringen
11/25/2024, 6:24 AMconnection.query("select x from y where z = $1", values)
• queryBuilder to built it in a more convenient way connection.queryBuilder.select('x').from('y').where('z', 'foo')
• orm layer
These are all covered by the pg
package and maybe a small ORM on top.
I've looked at Exposed, jOOQ, and subsequently JDBC and R2DBC as underlying tech. Correct me if I am wrong but I have noticed the following:
• R2DBC is not really 'popular' or used? Is there a reason that there isn't yet a great coroutine based Postgres or more generic DB driver? Exposed is JDBC based and as such locking threads. Since JDBC is still highly dominant I suspect it isn't that big of an issue actually in most cases?
• Exposed doesn't support raw prepared statements?
I can get there for 90% with Exposed, but the problem I have with DSL's like Exposed or jOOQ is that they almost never fully cover a DB dialect (for instance, jOOQ doesn't support the Postgres JSONB syntax). Therefore I always want an exit hatch to go to SAFE raw queries using prepared statements.
What would be the proper way forward? Please mind, it can be completely true that I've overlooked something....
EDIT: Sigh, after tying I see that jOOQ almost covers all my use-cases for the first and second bullet :DJohn Smith
11/25/2024, 6:48 AMJohn Smith
11/25/2024, 6:49 AMDSL.field("{0}->>{1}", String::class.java, field, name).eq(value)
where field
is Field<JSONB>
Arjan van Wieringen
11/25/2024, 6:51 AMJohn Smith
11/25/2024, 6:52 AMArjan van Wieringen
11/25/2024, 6:58 AMdave08
12/31/2024, 9:02 AM