https://kotlinlang.org logo
Title
s

Szymon Lipiński

10/07/2019, 12:12 PM
@Magno Junior Hey, here is my proof of concept how wiring of the Flyway with the ktor config file could look like. I used the libraries I'm going to use in my real project. https://github.com/szymonlipinski/ktor-flyway
m

Magno Junior

10/07/2019, 2:21 PM
@Szymon Lipiński thank you very much for share 🙇 I will take a look as soon as I arrive at home
@Szymon Lipiński I could not answer you properly yet about this thing. I really like the way that you create this FlywayMigrations.kt (https://github.com/szymonlipinski/ktor-flyway/blob/master/src/com/example/flyway/FlywayMigrations.kt) and how you use it on the rest of your code. I am still trying to think this way. really, thank you again for this code.
s

Szymon Lipiński

10/10/2019, 8:31 AM
Thanks. I think there is lot of places to improve the code. It was just an idea. In my real project I had to make some bigger refactoring. However, I think the general idea is fine.
m

Magno Junior

10/10/2019, 9:00 AM
@Szymon Lipiński I see you are using JDBI. Are you using it on "real scenario" as well? 🤔
s

Szymon Lipiński

10/10/2019, 9:01 AM
Yes. I like the declarative api: http://jdbi.org/#_declarative_api
m

Magno Junior

10/10/2019, 9:03 AM
yes... that's awesome. I mean, now I am using hibernates/jpa everywhere, but I like to see people in kotlin (not only here) is trying to avoid the classic ORM
s

Szymon Lipiński

10/10/2019, 9:07 AM
ORMs are fine for simple CRUD, however, in many situations you need to use some specific database features to get really fast queries, and suddenly the ORM is not fine.
m

Magno Junior

10/10/2019, 9:08 AM
yes.. I completely agree
s

Szymon Lipiński

10/10/2019, 9:08 AM
m

Magno Junior

10/10/2019, 9:11 AM
wow.. I need to see this carefully. I did it in the past using oracle and pl/sql.... but it was painful.
I fell like returning to year 2000 and something
s

Szymon Lipiński

10/10/2019, 9:16 AM
🙂 Sometimes simple functions can help a lot. The main trick is that the data doesn't need to travel to application. This way the stuff can be much faster. However, ORMs cannot handle that. In a previous project, I was working with, we used only sql, and it was pretty nice. Of course for each such dao function there had to be at least one test to check if the sql doesn't have any syntax issues (this is something the ORMs handle pretty well).
Generally I'd love to have an ORM for simple stuff and be able to use complex sql mapped to the same ORM classes, so I could reuse functions operating on the ORM stuff.