
Kotlin Exposed Patterns
This covers the practical patterns you need when working with JetBrains Exposed ORM in Kotlin. It shows both DSL and DAO query styles, sets up HikariCP connection pooling with proper transaction isolation, and wires in Flyway for versioned migrations. The examples are production-oriented: composite primary keys, cascading deletes, JSONB columns, and a repository pattern that lets you swap in H2 for testing. The DSL syntax is clean but the transaction wrapping with newSuspendedTransaction can feel verbose if you're coming from something like Spring Data. Best for greenfield Kotlin projects or microservices where you want more control than a full ORM gives you but don't want to write raw JDBC.
- skills.sh installs
- 4.6K
- GitHub stars
- 229.1K
- last updated
- Jul 14, 2026
Install
$ npx -y skills add affaan-m/everything-claude-code --skill kotlin-exposed-patterns --agent claude-codeInstalls into .claude/skills of the current project.
Files
Kotlin Exposed Patterns
Comprehensive patterns for database access with JetBrains Exposed ORM, including DSL queries, DAO, transactions, and production-ready configuration.
When to Use
- Setting up database access with Exposed
- Writing SQL queries using Exposed DSL or DAO
- Configuring connection pooling with HikariCP
- Creating database migrations with Flyway
- Implementing the repository pattern with Exposed
- Handling JSON columns and complex queries
How It Works
Exposed provides two query styles: DSL for direct SQL-like expressions and DAO for entity lifecycle management. HikariCP manages a pool of reusable database connections configured via HikariConfig. Flyway runs versioned SQL migration scripts at startup to keep the schema in sync. All database operations run inside newSuspendedTransaction blocks for coroutine safety and atomicity. The repository pattern wraps Exposed queries behind an interface so business logic stays decoupled from the data layer and tests can use an in-memory H2 database.
Examples
DSL Query
Sponsors
Details
- Repository
- github.com/affaan-m/everything-claude-code
- Categories
- Mobile Development, Java & JVM
- First seen
- Apr 16, 2026
More from affaan-m/everything-claude-code
All 256- Logistics Exception Management4.6K
- Mcp Server Patterns4.6K
- Production Scheduling4.6K
- Quality Nonconformance4.6K
- Videodb4.6K
- Agent Eval4.5K
- Claude Devfleet4.5K
- Dmux Workflows4.5K
- Perl Patterns4.5K
- Perl Security4.5K
- Perl Testing4.5K
- Returns Reverse Logistics4.5K
- Team Builder4.5K
- X Api4.5K
- Design System4.4K
- Nuxt4 Patterns4.4K
- Browser Qa4.3K
- Jira Integration4.3K
- Rules Distill4.3K
- Click Path Audit4.2K
- Git Workflow4.2K
- Hexagonal Architecture4.2K
- Remotion Video Creation4.2K
- Santa Method4.2K