Exposed

A Kotlin SQL library that provides:

  • A typesafe Domain-Specific Language (DSL) for constructing queries
  • Object-relational Mapping (ORM) style interaction
  • A Data Access Object (DAO) framework
Get Started

Why Exposed?

SQL
SQL
SQL

Framework-friendly

No lock-in. Exposed works with any framework you choose and offers built-in support for Spring Boot and Ktor.

Batteries included

Not limited by the basic database types and functions. Exposed supports the most popular types like JSON out of the box, and allows you to define custom types and custom functions yourself.

Database-agnostic

Supports a wide range of popular databases: PostgreSQL, MySQL, SQLite, Oracle, H2, and others.

By JetBrains

Developed and maintained by JetBrains. Exposed is actively used for developing JetBrains products.

What our community says

Goetz Markgraf

codecentric AG

With Exposed, you can simply write your query and be done. Over an interface like JDBC, you have type safety and reduced risk of SQL injection

Marvin Krüger

The author of the Watch2Gether Bot for Discord

I chose Exposed because it works well with the Kotlin codebase. Other tools require a lot of mangling and break code contracts that Kotlin is supposed to fix.

Maximilian Pergl

Senior Software Engineer at SumUp

Not a huge learning curve to it, appealing DSL. Integrated with Spring Boot. Before that, we had tried writing all SQL statements ourselves, which got a bit tedious.

Daniil Shulkin

Creator of Pixefy

Overall, compared to other tools, Exposed has several advantages: a code-first approach, no raw SQL for querying, meaning queries are type safe, and concise and convenient syntax for table definitions.

Join the community on the official Slack

Get invite