Heyy, can I use JPA in Ktor? I tried many orms lik...
# ktor
o
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
will check it, thank you!
f
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
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
https://github.com/komapper/komapper if you want something with R2DBC
k
Quarkus supports JPA FYI...
h
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
Alternative you could use sqldelight
o
@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
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
826 Views