I could understand that sqldelight is possibly a bit more flexible, as you can use any SQL features from what I see.
Where exposed does more work for you, providing helper functions and such, and keeping all relevant code in once place.
I have my own non blocking orm that supports r2dbc and the vertx async sql client, but this is at least some days away from a release, and has not many docs
j
Joel
03/05/2021, 5:28 PM
Hadn't seen sqldelight before, pretty neat. I like how it will pull in existing queries as functions. Two issues I see:
1. You're still basically writing SQL raw queries, whether you put them in a special file or inlined with kotlin code. I use an ORM because I don't want to introduce errors via custom SQL queries.
2. How does it handle queries of arbitrary length? i.e. I want to bulk insert N rows.
e
Endre Deak
03/05/2021, 6:39 PM
My 2 cents:
I think Exposed and SqlDelight are solving two different problems.
Exposed is a lightweight ORM so you can either write your SQL statements with it’s own DSL or apply certain mappings between database rows and entities while you have full control on what is happening.
SqlDelight seems more like a tool to do reads. I can definitely see a benefit of it on existing projects and it can leverage the work of converting the db row to a Kotlin type, but the main similarity with Exposed as I see is that they work with SQL.