Exposed ORM (JetBrains)
Lightweight SQL ORM framework for Kotlin by JetBrains. Provides two layers: a type-safe SQL DSL for building queries and a DAO (Data Access Object) layer for Active Record-style operations. Supports PostgreSQL, MySQL, H2, SQLite, and Oracle via JDBC. Designed for idiomatic Kotlin with coroutine support via exposed-kotlin-extensions.
Score Breakdown
⚙ Agent Friendliness
🔒 Security
No built-in connection string handling — application responsible for credentials. Parameterized queries prevent SQL injection. JDBC TLS support depends on driver configuration.
⚡ Reliability
Best When
Building Kotlin server-side applications (Ktor, Spring) that need type-safe SQL access without JPA complexity.
Avoid When
You need reactive/non-blocking database access, R2DBC support, or complex JPA features like L2 caching.
Use Cases
- • Build type-safe SQL queries in Kotlin with the Exposed DSL layer — compile-time verified column references and query structure
- • Implement Active Record-style database operations using Exposed's DAO layer for entity-centric access patterns
- • Access relational databases in Ktor or Spring Kotlin applications without the complexity of JPA/Hibernate
- • Write schema migrations by defining Table objects in Kotlin code and using SchemaUtils to create/alter tables
- • Integrate database access with Kotlin coroutines using newSuspendedTransaction for async-compatible DB access
Not For
- • Non-JDBC databases — Exposed is JDBC-only; use MongoDB Kotlin driver or Redis clients for NoSQL databases
- • R2DBC reactive/non-blocking database access — Exposed uses JDBC which is blocking; use Spring Data R2DBC for reactive access
- • Applications requiring full JPA/Hibernate feature set (caching, complex cascade, L2 cache) — use Hibernate with Kotlin
Interface
Authentication
Library uses standard JDBC connection pooling (HikariCP). Database credentials configured via JDBC URL or DataSource. No auth beyond DB credentials.
Pricing
JetBrains open source library. Apache 2.0 license — free for commercial and personal use.
Agent Metadata
Known Gotchas
- ⚠ All database access must be wrapped in a transaction block — Exposed throws IllegalStateException if you access DB outside a transaction
- ⚠ Exposed DSL and DAO layers are separate — don't mix them for the same table; pick one approach consistently
- ⚠ Schema migrations require manual SchemaUtils calls — Exposed does not auto-apply schema changes; run SchemaUtils.createMissingTablesAndColumns on startup
- ⚠ Coroutine support requires newSuspendedTransaction — standard transaction {} is blocking and should not be called from coroutine context without wrapping
- ⚠ Table column names default to property names — override with .name parameter if DB has different naming conventions (camelCase vs snake_case)
- ⚠ Exposed v0.40+ changed transaction handling for batched inserts — batchInsert behavior changed and may require code updates when upgrading
Alternatives
Full Evaluation Report
Detailed scoring breakdown, competitive positioning, security analysis, and improvement recommendations for Exposed ORM (JetBrains).
Scores are editorial opinions as of 2026-03-06.