sqlspec
Installation
SKILL.md
SQLSpec Skill
Project Overview
SQLSpec is a type-safe SQL query mapper for Python - NOT an ORM. It provides flexible connectivity with consistent interfaces across multiple database systems. Write raw SQL, use the builder API, or load SQL from files. All statements pass through a sqlglot-powered AST pipeline for validation and dialect conversion.
Key Design Principles
- Single Source of Truth: The
SQLobject holds all state for a given statement - Immutability: All operations on a
SQLobject return new instances - Type Safety: Parameters carry type information through the processing pipeline
- Separation of Concerns: Clear boundaries between statement representation, parameter processing, and driver execution
- Protocol-Based Design: Uses Python protocols for runtime type checking instead of inheritance
- Single-Pass Processing: Parse once, transform once, validate once