https://kotlinlang.org logo
Title
d

damian

12/04/2017, 2:41 PM
hey guys. i just jumped into developing a backend with kotlin yesterday (based on ktor); looking for a good solution for database access at the moment. so far i think i’ll go with
exposed
, but i cant really find samples/tutorials for the set-up, best-practices or something. in theory i’d want to deploy to heroku at some point (so postgresql i guess). maybe someone has some insights/hints for me?
d

dave08

12/04/2017, 9:29 PM
You might also look into #squash, which is more light weight... or the vert.x clients, if you need async...
b

bdawg.io

12/05/2017, 2:03 AM
Async is really nice if rxjava or coroutines interest you
d

damian

12/05/2017, 9:18 AM
thanks. i’ve already switched over from exposed to squash, trying it atm. first impression is that mapping a database table to objects is tedious (
MyTable.select(…fields…).execute().map { MyObject(it.get<String>(0), it.get<String>(1), …)}
) - is there a better way to do this?
d

dave08

12/05/2017, 9:55 AM
I've personally been wanting to switch to it, but haven't gotten there yet... I suggest you ask in #squash channel, good luck!
a

aglassman

12/05/2017, 10:52 PM
I’ve been converting data classes to JSONB for postgres. It’s really slick.
I’ve been using GSON, but now that kotlin has better JSON support, I may try that out.