The SQL library for Kotlin
open sourceApache-2.0free
Exposed is JetBrains' lightweight SQL library and ORM for Kotlin, running on top of a JDBC or R2DBC driver. It offers two ways to work with a database: a typesafe DSL that wraps SQL, and a lightweight Data Access Object (DAO) API. It supports H2, MariaDB, MySQL, Oracle, PostgreSQL, Amazon Redshift (JDBC only), Microsoft SQL Server and SQLite, so an application can switch database engines with little or no change. Extension modules add encrypted columns, date-time types, JSON and JSONB, money types, schema migration utilities and starters for Spring Boot 3 and 4.
Problems it solves
- query a SQL database from Kotlin with type checking instead of raw SQL strings
- map Kotlin objects to database tables without a heavy ORM
- switch my Kotlin app between PostgreSQL, MySQL and SQLite without rewriting queries
- use reactive database access in a Kotlin backend
Features
- typesafe SQL DSL
- lightweight DAO API
- JDBC and R2DBC drivers
- H2, MariaDB, MySQL, Oracle, PostgreSQL, Redshift, SQL Server and SQLite
- schema migration utilities
- encrypted and hashed column types
- JSON and JSONB column types
- Spring Boot 3 and 4 starters
Limitations
Alternatives
The same job
These do what Exposed does.
