Agent skill

Using Relational Databases

by ancoleman in ancoleman/ai-design-components

Relational database implementation across Python, Rust, Go, and TypeScript.

MITAuto-check passedDatabases

Install Using Relational Databases

skills CLI
$ npx skills add ancoleman/ai-design-components --skill using-relational-databases -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install ancoleman/ai-design-components using-relational-databases --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/ancoleman/ai-design-components.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/using-relational-databases .claude/skills/using-relational-databases && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
using-relational-databases
GitHub stars
526
Token cost
~2.5k tokens
SKILL.md length
684 words
Files
17 (incl. scripts, references)
Skills in repo
75
Repo updated
First seen
Licence
MIT

At a glance

Relational database implementation across Python, Rust, Go, and TypeScript.

  • Works in 3 steps: Use multi-phase deployment for column… → Use CREATE INDEX CONCURRENTLY… → Test migrations in staging with…
  • Building CRUD applications
  • SKILL.md covers Purpose, When to Use This Skill, Quick Reference: Database… and Quick Reference: ORM vs Query…, plus 7 more sections
  • Runs Python scripts from its folder

What it does

Using Relational Databases is an agent skill from ancoleman/ai-design-components. Relational database implementation across Python, Rust, Go, and TypeScript. Use when building CRUD applications, transactional systems, or structured data storage. Covers PostgreSQL (primary), MySQL, SQLite, ORMs (SQLAlchemy, Prisma, SeaORM, GORM), query builders (Drizzle, sqlc, SQLx), migrations, connection pooling, and serverless databases (Neon, PlanetScale, Turso).

Its SKILL.md is about 2.5k tokens, which your agent loads only when the skill is triggered. The skill folder holds 20 other files, including scripts and reference files (for example `examples/python-sqlalchemy/README.md`, `examples/python-sqlalchemy/main.py` and `outputs.yaml`).

It sits in Databases, covering ORMs and data access. It works with Prisma, SQLAlchemy, Python and TypeScript. The repository describes itself as: Comprehensive UI/UX and Backend component design skills for AI-assisted development with Claude. The licence is MIT.

When your agent uses it

  • Building CRUD applications
  • Transactional systems
  • Structured data storage

Example prompts

  • “/using-relational-databases”

Requirements

  • Python 3

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Use multi-phase deployment for column drops (never drop directly in production)
  2. Use CREATE INDEX CONCURRENTLY (PostgreSQL) to avoid blocking writes
  3. Test migrations in staging with production-like data volume

What it can do on your machine

Read from SKILL.md and the folder at commit 76551b7. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 2 files in scripts/ (Python), which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Using Relational Databases loads about 2.5k tokens when it runs, and up to ~34k if it reads all its reference files. Until then it costs about 100 tokens; SKILL.md has 684 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~100
When it runs · the whole SKILL.md, loaded when a task matches
~2.5k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~34k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from ancoleman/ai-design-components at commit 76551b7, republished under its MIT licence (© ancoleman). 684 words, ~2,467 tokens.

Download SKILL.mdSave it as .claude/skills/using-relational-databases/SKILL.md (or your agent's skills folder). This skill also uses 16 other files; get the full folder from GitHub.
name
using-relational-databases
description
Relational database implementation across Python, Rust, Go, and TypeScript. Use when building CRUD applications, transactional systems, or structured data storage. Covers PostgreSQL (primary), MySQL, SQLite, ORMs (SQLAlchemy, Prisma, SeaORM, GORM), query builders (Drizzle, sqlc, SQLx), migrations, connection pooling, and serverless databases (Neon, PlanetScale, Turso).

Relational Databases

Purpose

This skill guides relational database selection and implementation across multiple languages. Choose the optimal database engine, ORM/query builder, and deployment strategy for transactional systems, CRUD applications, and structured data storage.

When to Use This Skill

Trigger this skill when:

  • Building user authentication, content management, e-commerce applications
  • Implementing CRUD operations (Create, Read, Update, Delete)
  • Designing data models with relationships (users → posts, orders → items)
  • Migrating schemas safely in production
  • Setting up connection pooling for performance
  • Evaluating serverless database options (Neon, PlanetScale, Turso)
  • Integrating with frontend skills (forms, tables, dashboards, search-filter)

Skip this skill for:

  • Time-series data at scale (use time-series databases)
  • Real-time analytics (use columnar databases)
  • Document-heavy workloads (use document databases)
  • Key-value caching (use Redis, Memcached)

Quick Reference: Database Selection

Database Selection Decision Tree
═══════════════════════════════════════════════════════════

PRIMARY CONCERN?
├─ MAXIMUM FLEXIBILITY & EXTENSIONS (JSON, arrays, vector search)
│  └─ PostgreSQL
│     ├─ Serverless → Neon (scale-to-zero, database branching)
│     └─ Traditional → Self-hosted, AWS RDS, Google Cloud SQL
│
├─ EMBEDDED / EDGE DEPLOYMENT (local-first, global latency)
│  └─ SQLite or Turso
│     ├─ Global distribution → Turso (libSQL, edge replicas)
│     └─ Local-only → SQLite (embedded, zero-config)
│
├─ LEGACY SYSTEM / MYSQL REQUIRED
│  └─ MySQL
│     ├─ Serverless → PlanetScale (non-blocking migrations)
│     └─ Traditional → Self-hosted, AWS RDS, Google Cloud SQL
│
└─ RAPID PROTOTYPING
   ├─ Python → SQLModel (FastAPI) or SQLAlchemy 2.0
   ├─ TypeScript → Prisma (best DX) or Drizzle (performance)
   ├─ Rust → SQLx (compile-time checks)
   └─ Go → sqlc (type-safe code generation)

Quick Reference: ORM vs Query Builder

ORM vs Query Builder Selection
═══════════════════════════════════════════════════════════

TEAM PRIORITIES?
├─ DEVELOPMENT SPEED / DEVELOPER EXPERIENCE
│  └─ ORM (abstracts SQL, handles relations automatically)
│     ├─ Python → SQLAlchemy 2.0, SQLModel
│     ├─ TypeScript → Prisma (migrations, type generation)
│     ├─ Rust → SeaORM (Active Record + Data Mapper)
│     └─ Go → GORM, Ent
│
├─ PERFORMANCE / QUERY CONTROL
│  └─ Query Builder (SQL-like, zero abstraction overhead)
│     ├─ Python → SQLAlchemy Core, asyncpg
│     ├─ TypeScript → Drizzle, Kysely
│     ├─ Rust → SQLx (compile-time query validation!)
│     └─ Go → sqlc (generates types from SQL)
│
├─ TYPE SAFETY / COMPILE-TIME GUARANTEES
│  ├─ Rust → SQLx (queries checked at build time)
│  ├─ Go → sqlc (generates types from SQL)
│  ├─ TypeScript → Prisma or Drizzle
│  └─ Python → SQLModel (Pydantic integration)
│
└─ COMPLEX QUERIES / JOINS
   ├─ SQL-first → Query builders or raw SQL
   └─ ORM-friendly → SeaORM, SQLAlchemy ORM

Multi-Language Implementation

Python: SQLAlchemy 2.0 + SQLModel

Recommended Libraries:

  • SQLAlchemy 2.0 (/websites/sqlalchemy_en_21) - ORM + Core, 7,090 snippets
  • SQLModel - FastAPI integration, Pydantic validation
  • asyncpg - High-performance async PostgreSQL driver

When to Use:

  • Production applications requiring flexibility
  • FastAPI/Starlette backends
  • Async/await workflows

Quick Pattern:

python
from sqlmodel import SQLModel, Field, Session
class User(SQLModel, table=True):
    id: int | None = Field(default=None, primary_key=True)
    email: str = Field(unique=True, index=True)

See: references/orms-python.md for complete SQLAlchemy/SQLModel patterns, async workflows, and connection pooling.

TypeScript: Prisma vs Drizzle

Recommended Libraries:

  • Prisma 6.x (/prisma/prisma, score: 96.4, 4,281 doc snippets) - Best DX, migrations
  • Drizzle ORM (/drizzle-team/drizzle-orm-docs, score: 95.4, 4,037 snippets) - Performance, SQL-like

Quick Comparison:

  • Prisma: Best DX, auto-generated types, migrations included
  • Drizzle: Best performance, SQL-like syntax, zero overhead

See: references/orms-typescript.md for Prisma vs Drizzle detailed comparison, Kysely, TypeORM patterns.

Rust: SQLx (Compile-Time Checked)

Recommended Libraries:

  • SQLx 0.8 - Compile-time query validation, async
  • SeaORM 1.x - Full ORM with Active Record pattern
  • Diesel 2.3 - Mature, stable (sync/async)

Quick Pattern:

rust
use sqlx::FromRow;
#[derive(FromRow)]
struct User { id: i32, email: String, name: String }
// Compile-time checked queries (verified at build time!)
let user = sqlx::query_as::<_, User>("SELECT * FROM users WHERE email = $1")
    .bind("test@example.com").fetch_one(&pool).await?;

See: references/orms-rust.md for SQLx macros, SeaORM, Diesel patterns, and compile-time guarantees.

Go: sqlc (Type-Safe Code Generation)

Recommended Libraries:

  • sqlc - Generates Go code from SQL queries
  • GORM v2 - Full ORM with associations, hooks
  • Ent - Graph-based ORM, schema as code
  • pgx - High-performance PostgreSQL driver

Quick Pattern:

sql
-- queries.sql: SQL annotations generate type-safe Go code
-- name: CreateUser :one
INSERT INTO users (email, name) VALUES ($1, $2) RETURNING *;
go
user, err := queries.CreateUser(ctx, db.CreateUserParams{Email: "test@example.com"})

See: references/orms-go.md for sqlc setup, GORM, Ent, and pgx patterns.

Connection Pooling

Recommended Pool Sizes:

  • Web API (single instance): 10-20 connections
  • Serverless (per function): 1-2 connections + pgBouncer
  • Background workers: 5-10 connections

See: references/connection-pooling.md for configuration examples, sizing formulas, and monitoring strategies.

Migrations

Critical Principles:

  1. Use multi-phase deployment for column drops (never drop directly in production)
  2. Use CREATE INDEX CONCURRENTLY (PostgreSQL) to avoid blocking writes
  3. Test migrations in staging with production-like data volume

Tools: Alembic (Python), Prisma Migrate (TypeScript), SQLx migrations (Rust), golang-migrate (Go)

See: references/migrations-guide.md for safe migration patterns, multi-phase deployments, and rollback strategies.

Show full SKILL.md (287 more words)Show less

Serverless Databases

DatabaseTypeKey FeatureBest For
NeonPostgreSQLDatabase branching, scale-to-zeroDevelopment workflows, preview environments
PlanetScaleMySQL (Vitess)Non-blocking schema changesMySQL apps, zero-downtime migrations
TursoSQLite (libSQL)Edge deployment, low latencyEdge functions, global distribution

See: references/serverless-databases.md for setup examples, branching workflows, and cost comparisons.

Frontend Integration

Common Integration Patterns:

  • Forms skill: Form submission → API validation → Database CRUD (INSERT/UPDATE)
  • Tables skill: Paginated queries → API → Table display with sorting/filtering
  • Dashboards skill: Aggregation queries (COUNT, SUM) → API → KPI cards
  • Search-filter skill: Full-text search (PostgreSQL tsvector) → Ranked results

See working examples in: examples/python-sqlalchemy/, examples/typescript-drizzle/, examples/rust-sqlx/

Bundled Resources

Reference Documentation
  • references/postgresql-guide.md - PostgreSQL features (pgvector, PostGIS, TimescaleDB)
  • references/mysql-guide.md - MySQL-specific patterns, PlanetScale integration
  • references/sqlite-guide.md - SQLite patterns, Turso edge deployment
  • references/orms-python.md - SQLAlchemy 2.0, SQLModel, asyncpg
  • references/orms-typescript.md - Prisma, Drizzle, Kysely comparisons
  • references/orms-rust.md - SQLx, SeaORM, Diesel
  • references/orms-go.md - GORM, sqlc, Ent, pgx
  • references/migrations-guide.md - Safe schema evolution patterns
  • references/connection-pooling.md - Pool sizing and monitoring
  • references/serverless-databases.md - Neon, PlanetScale, Turso deployment
Working Examples
  • examples/python-sqlalchemy/ - SQLAlchemy 2.0 + FastAPI with pooling, migrations
  • examples/typescript-prisma/ - Prisma + Next.js with schema, migrations
  • examples/typescript-drizzle/ - Drizzle + Hono with type-safe queries
  • examples/rust-sqlx/ - SQLx + Axum with compile-time checks
  • examples/go-sqlc/ - sqlc + Gin with generated type-safe code
Utility Scripts
  • scripts/validate_schema.py - Validate database schema structure, constraints
  • scripts/generate_migration.py - Generate migration templates for common operations

Best Practices

Security:

  • Always use parameterized queries (prevents SQL injection)
  • Hash passwords with Argon2/bcrypt
  • Use environment variables for connection strings
  • Enable SSL/TLS in production

Performance:

  • Use connection pooling (10-20 for web APIs)
  • Create indexes on filtered/sorted columns
  • Implement pagination for large result sets
  • Use EXPLAIN ANALYZE for slow queries

Reliability:

  • Test migrations in staging first
  • Use transactions for multi-statement operations
  • Monitor connection pool exhaustion
  • Set up and test database backups

Development:

  • Version control schema and migrations
  • Use database branching (Neon) for features
  • Write integration tests against real databases

© ancoleman, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 16 other files (scripts, references) in skills/using-relational-databases of ancoleman/ai-design-components.

  • SKILL.md
  • examples/python-sqlalchemy/README.md
  • examples/python-sqlalchemy/main.py
  • examples/python-sqlalchemy/requirements.txt
  • outputs.yaml
  • references/connection-pooling.md
  • references/migrations-guide.md
  • references/mysql-guide.md
  • references/orms-go.md
  • references/orms-python.md
  • references/orms-rust.md
  • references/orms-typescript.md
  • references/postgresql-guide.md
  • references/serverless-databases.md
  • references/sqlite-guide.md
  • scripts/generate_migration.py
  • scripts/validate_schema.py

Open the folder on GitHubat commit 76551b7

Compare with similar skills

Using Relational Databases next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Using Relational Databases compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Using Relational Databases this skillancoleman/ai-design-components526—~2.5kAutomated safety check: PassMIT
Create Auth Skilldeadlock-mod-manager/deadlock-mod-manager4734 repos~3.4kAutomated safety check: PassGPL-3.0
Prisma 8 Contract-First ORMprisma/orm48k—~3.7kAutomated safety check: NotesApache-2.0
Better Auth Best Practicesviclafouch/meme-studio1105 repos~1.5kAutomated safety check: PassNone
Database Migrationsaffaan-m/ECC274k4 repos~3kAutomated safety check: PassMIT
Drizzle Orm Expertdavila7/claude-code-templates32k3 repos~2.6kAutomated safety check: PassMIT

Similar skills

  • Create Auth Skill

    deadlock-mod-manager/deadlock-mod-manager

    Scaffold and implement authentication in TypeScript/JavaScript apps using Better Auth.

    473 GitHub starsUsed in 4 repos~3.4k tokens
    DatabasesAuto-check passed
  • Official

    Routes Prisma 8 tasks such as contracts, migrations, queries and upgrades to the right reference files for projects on the contract-first @prisma/orm packages.

    48k GitHub stars~3.7k tokensUpdated today
    DatabasesAuto-check: notes
  • Better Auth Best Practices

    viclafouch/meme-studio

    Skill for integrating Better Auth - the comprehensive TypeScript authentication framework.

    110 GitHub starsUsed in 5 repos~1.5k tokens
    DatabasesAuto-check passed
  • Safe, reversible database migration patterns: forward-only production changes, expand-contract zero-downtime renames, concurrent indexes, batched backfills, and per-tool workflows for PostgreSQL…

    274k GitHub starsUsed in 4 repos~3k tokens
    DatabasesAuto-check passed
  • Drizzle Orm Expert

    davila7/claude-code-templates

    Expert in Drizzle ORM for TypeScript — schema design, relational queries, migrations, and serverless database integration.

    32k GitHub starsUsed in 3 repos~2.6k tokens
    DatabasesAuto-check passed
  • Prisma Patterns

    affaan-m/ECC

    Prisma ORM patterns for TypeScript backends — schema design, query optimization, transactions, pagination, and critical traps like updateMany returning count not records, $transaction timeouts…

    274k GitHub starsUsed in 1 repo~3.8k tokens
    DatabasesAuto-check: notes

More from ancoleman/ai-design-components

All 75 skills in this repo
  • Building AI Chat

    ancoleman/ai-design-components

    Builds AI chat interfaces and conversational UI with streaming responses, context management, and multi-modal support.

    526 GitHub starsUsed in 1 repo~3.4k tokens
    Auto-check passed
  • Building Forms

    ancoleman/ai-design-components

    Builds form components and data collection interfaces including contact forms, registration flows, checkout processes, surveys, and settings pages.

    526 GitHub stars~3.7k tokensUpdated 10 mo ago
    Auto-check passed
  • Building Tables

    ancoleman/ai-design-components

    Builds tables and data grids for displaying tabular information, from simple HTML tables to complex enterprise data grids.

    526 GitHub stars~1.8k tokensUpdated 10 mo ago
    Auto-check passed
  • Creating Dashboards

    ancoleman/ai-design-components

    Creates comprehensive dashboard and analytics interfaces that combine data visualization, KPI cards, real-time updates, and interactive layouts.

    526 GitHub stars~3.5k tokensUpdated 10 mo ago
    Auto-check passed
  • Designing Layouts

    ancoleman/ai-design-components

    Designs layout systems and responsive interfaces including grid systems, flexbox patterns, sidebar layouts, and responsive breakpoints.

    526 GitHub stars~1.7k tokensUpdated 10 mo ago
    Auto-check passed
  • Displaying Timelines

    ancoleman/ai-design-components

    Displays chronological events and activity through timelines, activity feeds, Gantt charts, and calendar interfaces.

    526 GitHub stars~2.7k tokensUpdated 10 mo ago
    Auto-check passed

Categories

Questions about Using Relational Databases

What does Using Relational Databases do?

Relational database implementation across Python, Rust, Go, and TypeScript. Using Relational Databases is an agent skill from ancoleman/ai-design-components. Relational database implementation across Python, Rust, Go, and TypeScript.

When should I use Using Relational Databases?

Using Relational Databases fits situations like: building CRUD applications; transactional systems; structured data storage.

How do I install Using Relational Databases in Claude Code?

Run `npx skills add ancoleman/ai-design-components --skill using-relational-databases -a claude-code`. Or copy the skill folder (skills/using-relational-databases in ancoleman/ai-design-components) into .claude/skills/using-relational-databases in your project. Claude Code loads it when a task matches its description.

How do I install Using Relational Databases in Codex?

Run `npx skills add ancoleman/ai-design-components --skill using-relational-databases -a codex`. Or copy the skill folder (skills/using-relational-databases in ancoleman/ai-design-components) into .agents/skills/using-relational-databases in your project. Codex loads it when a task matches its description.

Can I use Using Relational Databases in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ancoleman/ai-design-components --skill using-relational-databases -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/using-relational-databases, .gemini/skills/using-relational-databases, .github/skills/using-relational-databases and .opencode/skills/using-relational-databases in your project.

What does Using Relational Databases need to run?

Going by SKILL.md and its folder, Using Relational Databases needs Python for the scripts in its folder. Our summary lists: Python 3.

Does Using Relational Databases access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Using Relational Databases safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Using Relational Databases use?

Using Relational Databases is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Using Relational Databases use?

About 2.5k tokens (SKILL.md is roughly 9.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 31k tokens, read only when the agent opens those files.

What are the alternatives to Using Relational Databases?

Skills that share tags, products or a category with Using Relational Databases: Create Auth Skill (deadlock-mod-manager/deadlock-mod-manager, 473 stars), Prisma 8 Contract-First ORM (prisma/orm, 48k stars), Better Auth Best Practices (viclafouch/meme-studio, 110 stars) and Database Migrations (affaan-m/ECC, 274k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Using Relational Databases?

ancoleman (a GitHub user) maintains it in ancoleman/ai-design-components, which has 526 GitHub stars. The repository holds 75 skills in this directory. The repository was last updated on December 11, 2025.

Source: ancoleman/ai-design-components on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.