https://kotlinlang.org logo
#ktor
Title
# ktor
o

Okan Yıldırım

05/14/2022, 9:21 PM
Heyy, can I use JPA in Ktor? I tried many orms like Exposed or Ktorm, I didn't like any of them like Spring Data JPA. I was just simply creating a class with annotations and a repository, thats all. I am looking for something similar for Ktor
o

Okan Yıldırım

05/14/2022, 9:51 PM
will check it, thank you!
f

FunkyMuse

05/14/2022, 9:53 PM
However using JPA outside spring is just simply put, suicide, jooq works the best and i can see exposed is getting traction, I'm using jooq + postgresql and it's a breeze
o

Okan Yıldırım

05/14/2022, 9:56 PM
Well, my point is using a simple thing like JPA, using it is not necessary
I mean, I tried Exposed, it was like writing the same classes three times
I will check jooq, too. Thank you for suggestion
s

S.

05/14/2022, 9:58 PM
https://github.com/komapper/komapper if you want something with R2DBC
k

kenkyee

05/14/2022, 11:10 PM
Quarkus supports JPA FYI...
h

Hamza GATTAL

05/14/2022, 11:46 PM
In kotlin premier event Hadi said "the team have a plan for databases" , maybe in the future will see a library like jpa working exclusively with ktor
h

hfhbd

05/15/2022, 9:40 AM
Alternative you could use sqldelight
o

Okan Yıldırım

05/15/2022, 10:03 AM
@Hamza GATTAL it would be awesome if they just do something special for Ktor
I mean Ktor is very fun to use but the Database part makes me hate what I code
Thanks for other suggestions, I never heard some of them, let me check these
@S. Komapper looks inetersting let me give it a try
j

Junior Zytkowski

05/16/2022, 7:33 PM
Some people are working on a project to reduce boilerplate on Ktorm. You can check it out at https://github.com/kotlin-orm/ktorm-ksp We've tried implementing Hibernate on Ktor projects and I have to agree with @FunkyMuse, it's pretty suicidal to implement it. I personally don't enjoy exposed, on Ktorm you have to map an Entity and a Table (they are similar, but useful for typed queries). Can you further explain why you think you're writing too much code with Ktorm? Edit 1: Removed blank line
726 Views