Hi, anyone here tried to use sqldelight across all...
# multiplatform
r
Hi, anyone here tried to use sqldelight across all platforms, server, android plus any other, in shared code? What was the experience like, what are some quirks and pain points you faced?
👍 1
y
The plugin is unstable and crashes all the time. No support for building dynamic queries (ie, dynamic WHERE criteria). It’s just easier to use something like Kuery and don’t deal with all its quirks
t
Same here, I am unable to use the plugin, but it’s fine without it, just no autocomplete. Also I am running into an issue with wasm as it is not currently supported and they do not have the time to review a PR, which is very unfortunate. For Android, iOS, JVM desktop, no major issues here, apart from https://kotlinlang.slack.com/archives/C5HT9AL7Q/p1723144535162689 https://kotlinlang.slack.com/archives/C5HT9AL7Q/p1731365458761999 In my case I need to use an older version of SQLDelight (2.0.1) as the currently latest version is broken on Windows, and latest snapshots are not available. Unfortunately no response on my questions, but that is understandable of course for a free library. The older version works fine in production usage with no bugs.
k
Really depends on the platforms. Android and iOS, great. Server I have no idea, but jvm targets should be fine. I have no experience with dialects other than SQLite. Linux and windows tend to be kind of painful to set up due to SQLite linking. Js and warm, well. I never use the plugin so can't speak to issues.
a
Tried implementing sqldelight in wasm, the pain point is it runs the database in-memory and doesn't persist.
a
When proper template literals land in Kotlin it isn’t necessary to have all this compiler nonsense. I am developing NodeJS and Kotlin professionally and say what you will about the JS ecosystem, writing SQL and executing it is extremely easy. Kotlin doesn’t come close. It’s all okay if you want to do the most basic stuff, but anything remotely more complex in Postgres is basically impossible. All those ORMs, and typesafe query builders just add a basic layer that removes flexibility and add almost nothing. For Kotlin JVM we always fall back on simple PreparedStatements. It’s a little bit more boiler platery. But it always delivers. For simple crud we might add a basic ORM. For Multiplatform alas…
👍 1
âž• 1
k
Tried implementing sqldelight in wasm, the pain point is it runs the database in-memory and doesn't persist.
Presumably that's a browser restriction, unless you're talking about WASM in other contexts
On js and sql generally being a better experience, let's say that's an opinion and I wouldn't agree personally (I wrote "would" originally, whoops). On sqldelight, assuming it's set up correctly and you're not trying to run it in an uncommon environment (js/wasm), it's pretty great. I spend most of my time writing mobile, though.