Hey, what's the current state of database support ...
# announcements
n
Hey, what's the current state of database support in kotlin? I plan on building a rest api using ktor. Suprisingly, I couldn't find a proper async driver for MariaDB. Is there a reliable JDBC wrapper using kotlin coroutines?
m
Exposed is the official solution from JetBrains, though coroutines support is still on the roadmap: https://github.com/JetBrains/Exposed
n
hm exposed looks promising.. I'd just use my own threadpool for the blocking calls to the db then, right?
m
I haven't used ktor, so I can't really comment on how it, coroutines, and something like this would blend -- #exposed or #ktor might be better places to confirm that
n
ok, ill ask there. thanks for your help, really appreciate it!
👍 1
m
SQL Delight might be able to do this at some point. See https://github.com/square/sqldelight/issues/1009. I'm using it on the client side with a SQLite backend and it's working great, including coroutines flow support.
m
cool -- I didn't know they were thinking about databases beyond SQLite!
r
#exposed is not an “official” JB project AFAIK. It’s maintained by members of the JetBrains team, which is a separate designation.
@nyxcode
n
@Robert Menke good to know, thanks
m
my apologies for missing the distinction there -- I'll try to be more careful!
n
SQL Delight looks awesome, let's hope it gets MariaDB support soon 😄
to be completely honest, it's a bit frustrating to see that sql support is still lacking.. while exposed looks promising, it's not well documented and oficially "experimental". Maybe I'll just use plain old JDBC with my own threadpool, idk..
m
Make it open source 😁
r
I'm just experimenting with r2dbc - it's non-blocking, and works fine with kotlin coroutines (although I have some issues with object mapping)
n
@Robert Jaros interresting! What database are you using it for?
r
postgresql
but the drivers are available for other databases
including mysql/mariadb
n
ah, i see. https://github.com/mirromutth/r2dbc-mysql seems to be the only driver for mysql/mariadb, it doesn't seem to support coroutines though.
r
I'm using it without problems with official coroutines reactive extensions
n
hm, thats interresting. I'll give it a try right now! thanks.
yeah.. that seems to work, but i kinda dislike the bloated spring reactor stuff.. i'll just invest some time and build a dead-simple async jdbc wrapper myself.
g
I am building a rest api and started out with exposed. works fine, wish there was an automatic way to generate these Table objects from SQL or even better and .mwb file. In building the rest API however I ended up with spring boot... so I'm planning on removing exposed soon to minimize the frameworks I'm using and because setting up SSL looked less obvious with exposed. I've been studying kotlin a lot lately, IMHO its fully matured as a jvm scripting language... but everything else is experimental and really may not go anywhere... IMHO.
r
I mean it’s definitely not a scripting language
#exposed may not go anywhere, but #ktor, for example, should be here to stay
g
Yeah I guess its not a scripting language... well, in the kotlin/js I guess it is since it compiles to a scripting language. lol... it is what it is... its definitely a language we can agree on that, lol
d
#jasync-sql