# kotlin-orm/ktorm

A lightweight ORM framework for Kotlin with strong-typed SQL DSL and sequence APIs.

Repository: https://github.com/kotlin-orm/ktorm
Canonical: https://ross.abutalabs.com/products/ktorm
Homepage: https://www.ktorm.org
Language: Kotlin
License: Apache-2.0
License Family: permissive
Topics: kotlin, orm, sql, ktorm
Last push: 2026-06-20T15:30:12+00:00

## Health v2 (maintenance only)
Score: 80/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 88, release rhythm 57, longevity 100
- inputs: {"age_days": 2833, "days_push": 74, "days_rel": 74, "gap_med": 327.0, "n_releases_24m": 3}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2343, forks 161 (observed 2026-08-28T04:06:39.217389+00:00)

## What it is
Ktorm is a lightweight ORM framework for Kotlin built directly on pure JDBC, offering a strong-typed SQL DSL and entity sequence APIs. It requires no configuration files, XML, or annotations, and generates SQL automatically with fine-grained control.

## Use cases
- write type-safe SQL queries in Kotlin without XML or annotations
- replace MyBatis with a Kotlin-native ORM
- query databases using Kotlin collection-style sequence APIs
- map database tables to Kotlin entities with minimal boilerplate
- add database dialect support for MySQL, PostgreSQL, Oracle, SQLite, or SQL Server
- catch SQL bugs at compile time with a strong-typed DSL

## When to choose
- you're building a Kotlin/JVM application that talks to a relational database
- you want compile-time safety for SQL without annotations or codegen-heavy frameworks
- you prefer lightweight libraries with no third-party dependencies
- you want query code that reads like Kotlin's native collection APIs

## When to avoid
- you need a full-featured ORM with lazy loading, caching, and complex relationship management like Hibernate
- your team works primarily in Java rather than Kotlin
- you rely on JPA annotations and existing JPA entity mappings
- you need multi-tenant or advanced ORM features beyond Ktorm's scope

## Facets
- artifact type: library
- maturity: active
- function: orm, database, database-driver, serialization
- domain: databases, backend, web-development, developer-tools
- platform: jvm, cross-platform
- tags: kotlin, sql-dsl, jdbc, entity-sequence, type-safe-queries, no-annotations

## Member repositories
- kotlin-orm/ktorm (main) score 80

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:39.217389+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:37:14.547643+00:00, confidence not recorded.
  - readme: https://github.com/kotlin-orm/ktorm (fetched 2026-08-28T04:06:39.217389+00:00, sha 4093f77330f7)
  - homepage: https://www.ktorm.org (fetched 2026-08-29T10:17:42.176391+00:00, sha 318c4c63519c)
  - site_page: https://www.ktorm.org/api-docs/index.html (fetched 2026-08-29T10:17:42.235746+00:00, sha be57f55124e8)
- Data as of 2026-08-30T08:39:29.467469+00:00.
