(First public release) GitHub - urosjarc/db-messiah: Similar to JetBrains/Exposed, but without annotations, DSLs or DAOs. Strong focus on clean architecture and simplicity

I have been working on this library for the past 3 months,

GitHub - urosjarc/db-messiah: Similar to JetBrains/Exposed, but without annotations, DSLs or DAOs. Strong focus on clean architecture and simplicity.

Finally I came to a point to make public announcement for first stable release on maven central.

Maven Central: com.urosjarc.db-messiah

val result = it.query.get(output = Out::class, input = parent) {
    """
    SELECT ${it.column(Child::value)}  AS ${it.name(Out::child_value)},
           ${it.column(Parent::value)} AS ${it.name(Out::parent_value)}
    FROM ${it.table<Child>()}
    JOIN ${it.table<Parent>()} ON ${it.column(Parent::pk)} = ${it.column(Child::parent_pk)}
    WHERE ${it.column(Child::value)} = ${it.input(Parent::value)}
    """
}

I’m senior developer working on JDBC and Kotlin many many years and I pour into this library every peace of knowledge that I have. I have been using this library on my personal projects for some time and I’m planning to go into the production with the product which uses this library. My motivation was that I was not satisfied with exposed library and with the amount of work required to build some serious database structure… Also I wanted something simple which would better support clean architecture in my projects. I think I created a really nice peace of software that is worthy kotlin comunity.

I humbly ask for constructive review and opinion after you try the library.
All the best to you all!

Uroš Jarc

1 Like

I’m sure you put a lot of effort into rhis, but the example query doesn’t look very readable to me.
Also you say that it is based on reflecrion, which is known to be rather slow.
No DAOs also doesn’t sound like a good thing to me.
Ever had a look at Room for Android?

@robart Only on initialization library uses reflection to scan whole domain classes, after that it relies on hash maps to maps kclass-es and KProperties1 to appropriate domain objects which holds all information about the mapped element. I have done extensive benchmarks and can say that all bottlenecks are on JDBC calls, which I can’t do anything about… The library is designed to work almost at O(1), O(C) complexity, it’s lightning fast.

I would love to hear from you a little bit more about “doesn’t look very readable to me”, I’m more than wiling to accept feature/issue request from you to design the system as much user-friendly as I can get.

I have also redesigned README.md few days ago so I hope I clarified some things that you are interested in.

@robart Also can you explain about your concern related to DAO, I’m really interested what is your view around this.