kotlin-exposed-patterns

Apply Exposed DSL and DAO patterns with coroutine-safe transactions and HikariCP pooling.

3|Updated Mar 17, 2026
One-click install
npx skills add https://github.com/idiaz01/enterprise-superpowers --skill kotlin-exposed-patterns-idiaz01
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kotlin-exposed-patterns
Source: https://github.com/idiaz01/enterprise-superpowers/tree/main/content/skills/kotlin-exposed-patterns
Command: npx skills add https://github.com/idiaz01/enterprise-superpowers --skill kotlin-exposed-patterns-idiaz01

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

JetBrains Exposed ORM patterns address the challenge of building robust, maintainable data access layers in Kotlin applications by combining both DSL-based queries and DAO-style entity management, with built-in support for transactions, migrations, and repository-style organization.

Core Features & Use Cases

  • DSL Queries: Use the Exposed DSL to write type-safe, expressive SQL-like queries.
  • DAO Pattern & Entities: Manage entity lifecycle with Exposed DAO and entity mappings.
  • Transactions & Concurrency: Wrap operations in coroutine-safe transactions to ensure atomicity.
  • Connection Pooling: Configure HikariCP for efficient database connections.
  • Migrations: Apply Flyway migrations for schema versioning and evolution.
  • Repository Pattern: Structure data access behind repository interfaces for testability.

Quick Start

Install the pattern in your Kotlin project and start applying the Exposed patterns to your data layer.

Frequently Asked Questions about kotlin-exposed-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure Kotlin Exposed ORM transactions to be coroutine-safe?

To ensure coroutine-safe transactions in Kotlin Exposed, you must wrap database operations within transactional blocks scoped to coroutine contexts. This approach maintains atomicity and prevents concurrency issues across your data layer.

What is the best way to organize Kotlin Exposed queries for testability?

The best way to organize Kotlin Exposed queries for testability is implementing the repository pattern. Structuring data access behind repository interfaces isolates query logic and entities, simplifying unit testing.

How do I configure HikariCP connection pooling with the Exposed ORM in Kotlin?

Configuring HikariCP connection pooling with the Exposed ORM involves setting up HikariConfig properties and passing them to the Exposed transaction manager. This ensures efficient database connection reuse.

Does the Kotlin Exposed ORM support both DSL queries and DAO entity management?

Yes, the Kotlin Exposed ORM supports both DSL queries and DAO entity management. You can use the DSL for type-safe SQL-like queries while managing entity lifecycles through DAO mappings.

When should I use Flyway migrations with Kotlin Exposed?

You should use Flyway migrations with Kotlin Exposed when your application requires structured schema versioning and evolution. Flyway applies versioned SQL migrations to manage database changes systematically.