kotlin-exposed-patterns

Implement coroutine-safe JetBrains Exposed ORM repositories with CRUD, pagination, and migrations.

Updated Sep 13, 2025
One-click install
npx skills add https://github.com/llmh333/employee_management_spring --skill kotlin-exposed-patterns-llmh333
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kotlin-exposed-patterns
Source: https://github.com/llmh333/employee_management_spring/tree/main/.gemini/skills/kotlin-exposed-patterns
Command: npx skills add https://github.com/llmh333/employee_management_spring --skill kotlin-exposed-patterns-llmh333

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It solves the problem of building reliable, scalable database access layers in Kotlin using JetBrains Exposed without losing transaction safety in coroutines or coupling business logic to SQL details.

Core Features & Use Cases

  • Coroutine-safe transactions: Runs all database operations inside newSuspendedTransaction blocks for atomicity and coroutine correctness.
  • DSL and DAO query styles: Uses Exposed DSL for expressive SQL-like queries and DAO entities for lifecycle-oriented access.
  • Production-ready infrastructure: Configures HikariCP connection pooling and Flyway migrations, and supports a repository pattern to keep services decoupled and tests maintainable.

Quick Start

Use the kotlin-exposed-patterns skill to draft a coroutine-ready Exposed repository that performs CRUD, pagination, joins, JSONB handling, and Flyway-backed schema migrations for a PostgreSQL database.

Frequently Asked Questions about kotlin-exposed-patterns

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

FAQPage Schema
How do I use JetBrains Exposed with Kotlin coroutines for database access?

Use JetBrains Exposed with Kotlin coroutines by wrapping database operations in newSuspendedTransaction blocks. This ensures coroutine-safe, scalable database access while maintaining transaction atomicity and preventing blocking calls in asynchronous code.

What's the best way to structure a repository pattern using JetBrains Exposed?

Structure a repository pattern using JetBrains Exposed by defining repository interfaces to decouple business logic from SQL details. Implement CRUD, pagination, and joins using either DSL or DAO style for maintainable, testable data access layers.

How do I configure HikariCP connection pooling and Flyway migrations for Exposed?

Configure HikariCP connection pooling and Flyway migrations for Exposed by setting up production-ready infrastructure with HikariCP for connection management and Flyway for schema version control, ensuring reliable database operations in real-world services.

Does JetBrains Exposed support JSONB columns and pagination in Kotlin?

Yes, JetBrains Exposed supports JSONB columns and pagination in Kotlin. You can implement these features within coroutine-safe newSuspendedTransaction blocks, handling complex PostgreSQL data types and paginated query results efficiently.

When should I choose DSL vs DAO style in JetBrains Exposed?

Choose DSL style in JetBrains Exposed for expressive SQL-like queries, or DAO style for lifecycle-oriented entity access. Both integrate with newSuspendedTransaction for coroutine safety and can be combined within a repository pattern abstraction layer.