kotlin-exposed-patterns

Your message is missing a valid body for the requested action. Please try again.

1|Updated Mar 12, 2026
One-click install
npx skills add https://github.com/XiaoPuOuO/VFactory --skill kotlin-exposed-patterns-xiaopuouo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kotlin-exposed-patterns
Source: https://github.com/XiaoPuOuO/VFactory/tree/main/paperclip-official/AgentSetting/skills/kotlin-exposed-patterns
Command: npx skills add https://github.com/XiaoPuOuO/VFactory --skill kotlin-exposed-patterns-xiaopuouo

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Streamlines robust data access in Kotlin applications by providing ready-to-use Exposed ORM patterns (DSL and DAO), transaction handling, and production-ready configuration.

Core Features & Use Cases

  • Two query styles: DSL for direct queries and DAO for entity lifecycles, with coroutine-safe newSuspendedTransaction
  • Production-ready setup: HikariCP connection pooling and Flyway migrations
  • Repository pattern for testability and clean architecture, including example mappings to model objects

Quick Start

Run the Exposed-based setup by configuring a Kotlin project, a PostgreSQL database, and a coroutine-enabled repository usage.

Frequently Asked Questions about kotlin-exposed-patterns

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

FAQPage Schema
How do I handle database transactions safely with Kotlin coroutines in Exposed?

To ensure coroutine-safe database transactions in Kotlin Exposed, you should use newSuspendedTransaction. This function prevents thread blocking and maintains transactional integrity when performing relational data access within coroutine-based backend services.

What's the best way to structure a Kotlin Exposed data layer for testability?

The best way to structure a Kotlin Exposed data layer for testability is implementing the repository pattern. This decouples business logic from database access by mapping Exposed results to model objects, enabling isolated testing across PostgreSQL and in-memory databases.

When should I use DSL versus DAO query styles in JetBrains Exposed?

Use the DSL style in JetBrains Exposed for direct, lightweight queries, and use the DAO style when you need managed entity lifecycles. Both patterns support production-ready configurations, letting you choose based on specific data access complexity.

How to configure HikariCP connection pooling and Flyway migrations for Kotlin Exposed?

Configure HikariCP connection pooling and Flyway migrations in your Kotlin Exposed project by setting up a PostgreSQL database environment. This production-ready setup ensures reliable connection management and automated schema migrations for your relational data layer.

Does Kotlin Exposed support both PostgreSQL and in-memory databases for testing?

Yes, Kotlin Exposed supports both PostgreSQL and in-memory databases for testing. By applying a repository-based data layer, you can seamlessly switch between a production PostgreSQL setup and lightweight in-memory databases for isolated tests.