All Versions
Latest Version
Avg Release Cycle
36 days
Latest Release
87 days ago

Changelog History

  • v2.6

    November 02, 2019

    πŸ‘Œ Support Running on Android Devices (#22)

    πŸ‘ Now, Ktorm is available for Android SQLite with the support of SQLDroid driver. And technically, any other JDBC driver is also supported (if you really need them running on Android).

    ⚑️ Update JVM Target to 1.6

    ⚑️ For maximum compatibility, we updated the compiler option -jvm-target to 1.6. This option is used to specify the version of the generated JVM bytecode. Moreover, to support running on Android and JDK 1.6, we added three SqlType implementations, they supports java.sql.Timestamp, java.sql.Date and java.sql.Time, because JSR-310 is not available on those platforms.

    πŸ‘Œ Support Multiple Bindings on One Column

    Now, we can bind a column to multiple properties by calling the bindTo or references functions continuously. In this way, when an entity object is retrieved from the database, the value of this column will be filled to each property it binds.

    interface Config : Entity\<Config\> { val key: Stringvar value1: Stringvar value2: String}object Configs : Table\<Config\>("t\_config") { val key by varchar("key").primaryKey().bindTo { it.key } val value by varchar("value").bindTo { it.value1 }.bindTo { it.value2 } }

    In the example above, we bound the value column to both value1 and value2, so the values of these two properties would be the same in an entity object obtained from the database.

    ⚑️ > Please note that multiple bindings are only available for query operations. When we are inserting or updating an entity, the first binding will prevail, and other bindings will be ignored.

    πŸ‘Œ Support Column Alias DSL (by @waluo, #37)

    Now, we can assign aliases to the selected columns of a query and use them in subsequent clauses such as group by and having, just like the as keyword in SQL. Here is an example. This query selects departments whose average salary is greater than 100, then returns the average salaries along with their department’s IDs.

    val deptId = Employees.departmentId.aliased("dept\_id")val salaryAvg = avg(Employees.salary).aliased("salary\_avg")Employees .select(deptId, salaryAvg) .groupBy(deptId) .having { salaryAvg greater 100.0 } .forEach { row -\>println("${row[deptId]}:${row[salaryAvg]}") }

    Generated SQL:

    select t\_employee.department\_id as dept\_id, avg(t\_employee.salary) as salary\_avg from t\_employee group by dept\_id having salary\_avg \> ?

    πŸ›  Other Optimizations and Bug Fixes

    • ♻️ Refactoring the implementation of QueryRowSet.
    • πŸ‘Œ Support SQL Server datetimeoffset data type.
    • Max/min aggregation functions' type arguments should be Comparable instead of Number (#46).
  • v2.5

    August 24, 2019

    πŸ‘ Appreciation for the support and suggestions from @waluo

  • v2.4

    June 26, 2019
    • ⬆️ Upgrade Kotlin version to 1.3.40.
    • πŸ”Š Auto detect the third-party logging framework we are using from the classpath, and delegate Ktorm's logs to it. #15
    • πŸ‘‰ Use JDK ServiceLoader to find a dialect. Now we don't have to specify the dialect parameter explicitly while creating Database instances. #5
    • βž• Add match and against functions for MySQL fulltext search, translated to its match ... against ... syntax. #25
    • βž• Add insertOrUpdate function for PostgreSQL's data "upsert", translated to its on conflict (key) do update set syntax. #26
    • πŸ›  Other optimizations and bug fixes.
  • v2.3

    June 09, 2019
    • Documents for all public classes and functions.
    • πŸ‘ Throw DialectFeatureNotSupportedException while a feature is not supported by a dialect.
    • πŸ›  Other optimizations and bug fixes.
  • v2.2

    May 05, 2019

    βž• Add a logging facade and the slf4j dependency is removed. (#4)
    🌲 Documents can be found at

  • v2.1

    April 26, 2019
    • βž• Add function asSequenceWithoutReferences to disable the auto joining of reference tables.
    • βž• Add function mapColumns to select a particular column from tables.
    • βž• Add dateDiff function for MySQL.
    • πŸ“‡ Rename function aggregate to aggregateColumns.
    • Mark some internal APIs as @PublishedApi.
  • v2.0

    April 12, 2019
  • v1.3

    March 28, 2019
    • πŸ›  Fix bug #9, generate smart count SQLs.
    • πŸ›  Fix bug #10, check unexpected discard changes.
    • πŸ›  Other optimizations and bug fixes.
  • v1.2

    December 27, 2018
    • Detect circular table references and fail fast
    • πŸ‘Œ Support binding a column to triple nested properties

    December 14, 2018