About this project
Exposed is an official JetBrains project that provides a lightweight SQL library and ORM framework for the Kotlin programming language. Built on top of database connectivity drivers, it supports both JDBC and R2DBC (since version 1.0.0) drivers, offering two distinct approaches for database access: a typesafe SQL-wrapping Domain-Specific Language (DSL) and a lightweight Data Access Object (DAO) API.
The project's mascot is the cuttlefish, chosen for its ability to mimic various environments—similar to how Exposed can adapt to a variety of database engines, enabling developers to build applications without dependencies on any specific database and switch between them with minimal changes.
Supported databases include H2 (2.x), MariaDB, MySQL, Oracle, PostgreSQL (including pgjdbc-ng), Amazon Redshift (JDBC only), Microsoft SQL Server, and SQLite.
The framework is organized into core modules: exposed-core provides foundational components and the DSL API; exposed-dao (optional) enables the DAO API and is compatible only with exposed-jdbc; exposed-jdbc provides JDBC transport-level implementation; and exposed-r2dbc provides reactive relational database connectivity support.
Extension modules cover additional functionality including encrypted data storage (exposed-crypt), date-time handling via Java 8 Time API, Joda-Time, and kotlinx-datetime, JSON/JSONB data types (exposed-json), monetary amounts (exposed-money), database schema migrations (exposed-migration-core, exposed-migration-jdbc, exposed-migration-r2dbc), and Spring Boot integration starters for Spring Boot 3 and 4, along with Spring Framework transaction managers.
Requirements include Kotlin 2.2+ and JDK 8+ for most modules, with JDK 11+ required for R2DBC-related modules and JDK 17+ for Spring-related modules and exposed-crypt.
The DSL approach allows developers to define tables as Kotlin objects with typed columns, perform CRUD operations, execute joins, use SQL functions, and apply group-by clauses—all with compile-time type safety. The DAO approach provides entity classes with companion objects for querying, supporting lazy-loaded relationships and referrers.
Releases are available on Maven Central under the org.jetbrains.exposed namespace. The project is licensed under Apache License 2.0 and welcomes contributions via pull requests linked to issues on JetBrains YouTrack.
Comments
0 Rating appears after 10 ratings
Sign in to join the discussion.