exposed-r2dbc

Implement reactive database access with Exposed, R2DBC, and Kotlin Coroutines.

8|1|Updated May 19, 2025
One-click install
npx skills add https://github.com/bluetape4k/exposed-r2dbc-workshop --skill exposed-r2dbc
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: exposed-r2dbc
Source: https://github.com/bluetape4k/exposed-r2dbc-workshop/tree/main/.omc/skills/exposed-r2dbc
Command: npx skills add https://github.com/bluetape4k/exposed-r2dbc-workshop --skill exposed-r2dbc

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill eliminates the steep learning curve and repetitive boilerplate work of implementing reactive database access with JetBrains Exposed, R2DBC, and Kotlin Coroutines, helping developers avoid common pitfalls and accelerate production-ready reactive backend development.

Core Features & Use Cases

  • Reactive SQL DSL Patterns: Pre-built, production-grade patterns for table definition, DML operations (INSERT, SELECT, UPDATE, DELETE) using Exposed's R2DBC Flow API, compatible with H2, PostgreSQL, MySQL, and MariaDB.
  • Coroutine-First Transaction Management: Ready-to-use suspendTransaction patterns and test infrastructure for safe, efficient coroutine-based database workflows in Spring WebFlux or Ktor applications.
  • Cross-Dialect Testing: Parameterized test templates for validating database code across multiple SQL dialects without rewriting test logic.
  • Use Case: A developer building a reactive e-commerce backend can use this Skill to quickly implement a multi-tenant product repository with caching and routing datasource patterns, backed by automated cross-database tests.

Quick Start

Use the exposed-r2dbc skill to implement a reactive user repository with suspendTransaction and multi-database parameterized tests for your Kotlin Exposed R2DBC project.

Frequently Asked Questions about exposed-r2dbc

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

FAQPage Schema
How do I manage reactive database transactions with Kotlin Coroutines and Exposed?

To manage reactive database transactions with Kotlin Coroutines and Exposed, use production-grade `suspendTransaction` patterns. These patterns ensure coroutine-safe database workflows and efficient transaction handling within Spring WebFlux or Ktor reactive backend services.

What's the best way to write cross-dialect tests for Exposed R2DBC database code?

The best way to write cross-dialect tests for Exposed R2DBC is using parameterized test templates. These templates validate database operations across H2, PostgreSQL, MySQL, and MariaDB dialects without requiring you to rewrite test logic for each specific database environment.

Can I use Exposed R2DBC for multi-tenant database schema handling?

Yes, you can use Exposed R2DBC for multi-tenant schema handling. The skill provides production-grade patterns for multi-tenant repository implementations, including caching and routing datasource configurations tailored for reactive Kotlin backend applications.

How does Flow-based result processing work with Exposed R2DBC?

Flow-based result processing with Exposed R2DBC works by leveraging Exposed's R2DBC Flow API for DML operations. This approach allows SELECT, INSERT, UPDATE, and DELETE results to be processed reactively as streams, integrating seamlessly with Kotlin Coroutines.

Does the Exposed R2DBC skill support Spring WebFlux and Ktor?

Yes, the Exposed R2DBC skill supports both Spring WebFlux and Ktor. It targets Kotlin backend developers building reactive services in these frameworks, providing compatible table definitions, transaction management, and test infrastructure for efficient coroutine-based workflows.

Why does my Kotlin Coroutines database operation block the thread with Exposed?

Your Kotlin Coroutines database operation might block the thread if not using `suspendTransaction` patterns. Implementing reactive database access with Exposed R2DBC requires coroutine-safe transaction management to avoid common pitfalls and ensure non-blocking execution.