effect-sql-db

Integrate SQL database clients with Effect for typed errors and transactions.

5|Updated Nov 18, 2025
One-click install
npx skills add https://github.com/mepuka/effect-ontology --skill effect-sql-db
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: effect-sql-db
Source: https://github.com/mepuka/effect-ontology/tree/main/.claude/skills/effect-sql-db
Command: npx skills add https://github.com/mepuka/effect-ontology --skill effect-sql-db

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Effect patterns for SQL databases (Drizzle/Kysely/Prisma): services, transactions, retries, streaming, and observability.

Core Features & Use Cases

  • Layer-provided DB config and DB services
  • Typed Database errors and transactional patterns with retry
  • Query helpers and streaming examples
  • Observability for slow queries

Quick Start

Implement a Database service and wrap critical sections in a transaction with retry on deadlock.

Frequently Asked Questions about effect-sql-db

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

FAQPage Schema
How do I implement transactional SQL database operations with Effect?

Transactional SQL with Effect requires wrapping database operations in a transaction service that handles commits, rollbacks, and retry logic. This Skill provides typed transaction patterns for Drizzle, Kysely, Prisma, mysql2, and pg clients, automatically retrying on deadlocks and mapping low-level driver errors to a unified DatabaseError type.

Can I use Prisma or Drizzle with Effect for database operations?

Yes. This Skill integrates Prisma, Drizzle, Kysely, mysql2, and pg with Effect by centralizing database configuration in a service layer, enabling typed error handling, transactional support, and built-in retry policies for deadlock scenarios across all supported clients.

What's the best way to handle database deadlocks in Effect applications?

Implement retry policies at the transaction level using Effect's retry combinators. This Skill provides deadlock-aware transactional patterns that automatically retry failed operations according to configurable policies, integrated with your Effect service layer and observable through hooks for monitoring.

How do I add observability to SQL database queries in Effect?

This Skill exposes observability hooks for slow query detection and monitoring. Wrap database operations in the provided transaction service to capture execution metrics, integrate with your Effect observability stack, and identify performance bottlenecks across Drizzle, Kysely, Prisma, and native SQL drivers.

Do I need a database service layer when using Effect with SQL clients?

Yes, for production Effect applications. A service layer centralizes database configuration, error mapping, and transactional logic, reducing boilerplate and ensuring consistent retry and observability behavior. This Skill provides the service patterns you need for Drizzle, Kysely, Prisma, mysql2, and pg.

Can I stream large result sets with Effect and SQL databases?

This Skill includes streaming examples for query results with Effect. Stream patterns integrate with the transaction and error-handling infrastructure, allowing you to process large datasets efficiently while maintaining retry semantics and observability across Drizzle, Kysely, Prisma, and native drivers.