What’s Ktorm?
Ktorm is a lightweight and efficient ORM Framework for Kotlin directly based on pure JDBC. It provides strong-typed and flexible SQL DSL and convenient sequence APIs to reduce our duplicated effort on database operations. All the SQL statements, of course, are generated automatically. Ktorm is open source and available under the Apache 2.0 license, and its code can be found on GitHub. Please leave a star if you’ve found this library helpful: kotlin-orm/ktorm
Features
- No configuration files, no XML, no annotations, even no third-party dependencies, lightweight, easy to use.
- Strong typed SQL DSL, exposing low-level bugs at compile time.
- Flexible queries, fine-grained control over the generated SQLs as you wish.
- Entity sequence APIs, writing queries via sequence functions such as
filter
,map
,sortedBy
, etc., just like using Kotlin’s native collections and sequences. - Extensible design, write your own extensions to support more operators, data types, SQL functions, database dialects, etc.
Articles
- Extend JSON Support for Ktorm’s PostgreSQL Dialect NEW
- Ktorm - Write Your Database Operations in Kotlin Style
- Still Using MyBatis? Try Ktorm, an ORM Framework for Kotlin!
Quick Start
Setting up Ktorm and starting up.
SQL DSL
Use the strong-typed and flexible query DSL after defining table schemas.
Entity Sequence
Obtain entities via sequence APIs after column bindings configured.
API Documents
API documents for Ktorm's classes and functions.