https://kotlinlang.org logo
#exposed
Title
# exposed
g

Goetz Markgraf

02/10/2023, 2:32 PM
Hello everyone. I am thinking of using exposed for the next customer project. Are there any experience of using it in the field? I mean, it’s version number is still 0.X and it is not supported by JetBrains but a staff project. Do you have any references to customers using exposed commercially / professionally?
p

PoisonedYouth

02/10/2023, 2:56 PM
What are youre requirements? I'm using SpringBoot + Exposed (with a MySQL/Postgresql) database in production. Until now (1 year) there haven't been any problems related to Exposed but I have not a very complicated datastructure.
a

Andrew O'Hara

02/10/2023, 3:00 PM
For a Kotlin library, Exposed is incredibly popular and almost universally praised. The JetBrains team is currently looking for a database export to help support it through 1.0+, but it is feature complete. Even if you're missing something, the library makes it incredibly easy to add it yourself; that's the beauty of modern libraries like this.
g

Goetz Markgraf

02/10/2023, 3:02 PM
@PoisonedYouth That sounds great. I like to API of exposed and I know that it will suite our needs. But I have no information about stability and errors in production. @Andrew O'Hara Now, that sounds promising. Do you – by any chance – happen to have some links for it (popularity / praise)? I don’t need convincing, but my client might …
a

Andrew O'Hara

02/10/2023, 3:15 PM
I don't really have anything specific to share--unless I were to self-promote my own works. I frequent a few Kotlin communities, and any time the subject of database mappers is brought up, Exposed is guaranteed to be a top suggestion. From my own experience, compared to: Raw JDBC - Exposed takes a bit more effort to optimize, but much more type-safe, more productive, and easier to test Hibernate - Exposed is much easier to optimize efficiency, is much more type-safe, but I'm not sure about ease of testing
🙏 1
p

PoisonedYouth

02/10/2023, 3:23 PM
Hibernate is too much magic for me. Exposed is more direct. Just giving type-safety and out-of-the-box queries. If using SpringBoot it is a good help to use SpringTransaction instead of the manual Exposed ones. Testing exposed is very straight-forward. Using it together with SpringBoot, makes it easy to write integration tests (against in-memory database or testcontainers). Using it without SpringBoot you can manually setup a database for tests (again using in-memory or testcontainers).
👍 1
g

Goetz Markgraf

02/10/2023, 3:25 PM
Currently we are using Spring / Spring Boot with JPA/Hibernate. But that in total is too much magic and much too fat for a HTTP Backend. So we are evaluation ktor and need a DB framework. exposed looks very promising!
K 1
p

PoisonedYouth

02/10/2023, 3:34 PM
Also my favourite combination for a lightweight http backend
e

Endre Deak

02/13/2023, 10:13 PM
d

Damien O'Hara

02/15/2023, 2:39 PM
I used Exposed for a while on a commercial project. it is productive if you are willing to work work within its limitations but we found the SQL layer was missing major SQL features and did not accurately model those SQL features it did have. it also doesn't have a story around schema migration. we ended up switching to a hand-rolled SQL library
would definitely recommend it as a lightweight alternative to other ORMs though - especially if you are happy to use Flyway or some other third party tool to manage migrations
1
e

Endre Deak

02/15/2023, 3:50 PM
I can confirm by experience that doing schema management with Flyway and then connecting your application layer to the database via Exposed plays out well
@Damien O'Hara what other lib you chose to overcome those limitations you mentioned?
d

Damien O'Hara

02/15/2023, 4:05 PM
@Endre Deak I built one and we switched around Q4 2021
a

Andrew O'Hara

02/15/2023, 4:21 PM
Apparently a schema change tool is on the roadmap for Exposed. I'm curious though; are there actually other well-known ORMs (for Kotlin) that have a schema change tool? I had assumed that flyway was the only real option.
8 Views