effect-sql

Create typed SQL queries for PostgreSQL with @effect/sql and SqlSchema.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/lucas-barake/dotai --skill effect-sql
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: effect-sql
Source: https://github.com/lucas-barake/dotai/tree/main/canonical/skills/effect-sql
Command: npx skills add https://github.com/lucas-barake/dotai --skill effect-sql

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Enable safe, typed SQL queries for relational data in TypeScript applications using @effect/sql and SqlSchema.

Core Features & Use Cases

  • SqlSchema.single, .findOne, .findAll, and .void for typed query patterns
  • PostgreSQL client configuration and integration with effect
  • Transactions, JSON handling, and complex query templates

Quick Start

Define a SqlSchema single query to fetch a user by id.

Frequently Asked Questions about effect-sql

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

FAQPage Schema
How do I write typed SQL queries for PostgreSQL in TypeScript?

Typed SQL queries for PostgreSQL in TypeScript are written using @effect/sql and SqlSchema to enforce runtime validation. This approach supports single-result fetch, optional fetch, multi-row queries, and write operations across repositories and migrations.

What is the best way to validate SQL query results at runtime in TypeScript?

Runtime validation of SQL query results in TypeScript is handled using SqlSchema patterns like .single, .findOne, and .findAll. These methods ensure that data returned from PostgreSQL queries matches the expected schema at runtime.

How do I handle database transactions with Effect in a TypeScript data access layer?

Database transactions with Effect are handled within the data access layer using the PostgreSQL client configuration. The Skill supports advanced features such as transactions, JSON handling, and SQL template helpers for complex write operations across repositories.

Can I use Effect SqlSchema for optional fetch and multi-row queries in PostgreSQL?

Yes, Effect SqlSchema can be used for optional fetch and multi-row queries in PostgreSQL. It provides specific patterns including .findOne for optional single results and .findAll for fetching multiple rows with runtime validation.

Does this typed SQL pattern support JSON handling and SQL template helpers?

Yes, the typed SQL pattern supports JSON handling and SQL template helpers. These advanced features are integrated alongside PostgreSQL client configuration to manage complex data structures within TypeScript applications using @effect/sql.