ktorm
ktorm copied to clipboard
A lightweight ORM framework for Kotlin with strong-typed SQL DSL and sequence APIs.
Given the following pseudocode - ``` val employee = Employee{ //Info for a new employee department = Department{ //Info for a new department } } database.sequenceOf(Employee, withReferences = true) .add(employee)...
We usually use cursor pagination instead of offset pagination, as the performance is better https://dev.to/jackmarchant/offset-and-cursor-pagination-explained-b89
An example of implicit join can be found in JOOQ library ``` create.select( BOOK.author().FIRST_NAME, BOOK.author().LAST_NAME, BOOK.TITLE, BOOK.language().CD.as("language")) .from(BOOK) .fetch(); ``` https://www.jooq.org/doc/3.12/manual/sql-building/sql-statements/select-statement/implicit-join/ https://blog.jooq.org/2018/02/20/type-safe-implicit-join-through-path-navigation-in-jooq-3-11/
I've the following method (I've removed some lines for brevity): ```kotlin fun save(entity: E, attrsToOverride: Map): Any { return table.insertAndGenerateKey { builder -> entity.properties.forEach { (key, value) -> builder[key] to...
I don't see a way to set a `limit` on an `update` with the SQL DSL. Is this supported? I need to generate something like this SQL: ```` update mytable...
When declaring an entity's columns along with its corresponding table, you have to specify a column's name, one way or the other, at least 4 times. This is tiring and...
Consider introducing annotation processor tools to generate boilerplate codes like: ````kotlin interface Department : Entity { companion object : Entity.Factory() val id: Int var name: String var location: String }...
I am trying to use innerJoin for joining two tables. ``` ktormDatabase.from(TransactionTable) .innerJoin(UserTable, on = TransactionTable.userId eq UserTable.id) .select() ``` When I try to specify the join condition I get...
Or do i have to support it myself during creation/updating?