Why isn't Sqldelight kotlin friendly? why do i ha...
# squarelibraries
y
Why isn't Sqldelight kotlin friendly? why do i have to create a table then i need to map it to my data class model can't it be just like annotations like you give an annotations to a data class and that's it you just created a table and no need to map it
j
You can watch this presentation about its design and why the annotation approach doesn't work:

https://www.youtube.com/watch?v=4eUuD7LsqMs

If you still want to use annotations, try Room
Next time consider asking questions in a tone that actually make people want to answer them.
3
y
I was just mad my bad
j
It happens to us all. I promise SQL Delight has been designed thoughfully, but you may not agree with its principles. That's fine, we don't need 100% of users. Other libraries make different trade-offs.
y
For multiplatform there isn't any other libraries
j
There's exposed by JetBrains. Realm by MongoDB.
👍 1
👍🏻 1
p
JS is only supported by SQLDelight, huge impact 😛😀
j
Depending on your use case, you might check out my KMP library, Kotbase, for the JSON document database Couchbase Lite. It supports SQL, key/value, and FTS queries. As Jake said, all persistence libraries have their trade-offs. I find Couchbase Lite to be flexible and avoids many of the pitfalls of object DBs and ORMs.
It'd be interesting to explore if SQLDelight's SQL tooling could be used in conjunction with Kotbase, which has both query builder and raw SQL string APIs. Maybe a SQL++ for JSON dialect could be a helpful addition. It might also be utilized for Couchbase Server's Kotlin SDK, or AsterixDB.
👀 1