database

database is a skill for Claude Code, Codex from LuuOW/meridian-mcp. It costs 54 tokens per session (1,347 once invoked), scanned A, original, MIT.

Guidance for building and maintaining relational database features with PostgreSQL, SQLAlchemy, asyncpg, Alembic, Supabase clients, and Node or Python applications. It covers storing related data in tables, changing schemas, and running queries efficiently.

In plain words
What is it for?
Use it when writing asynchronous queries, defining or migrating schemas, choosing indexes, managing connections and transactions, or performing bulk database operations.
Why use it?
It provides consistent patterns for database connections, migrations, transactions, indexes, pooling, and bulk operations.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/luuow/meridian-mcp/database
Any agent
npx skills add LuuOW/meridian-mcp --skill database
Clone the repo
git clone --depth 1 https://github.com/LuuOW/meridian-mcp

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for database

README.md
[![agentmods](https://agentmods.dev/badge/skills/luuow/meridian-mcp/database.svg)](https://agentmods.dev/skills/luuow/meridian-mcp/database)
Your own site
<a href="https://agentmods.dev/skills/luuow/meridian-mcp/database"><img src="https://agentmods.dev/badge/skills/luuow/meridian-mcp/database.svg" alt="Measured on agentmods" height="20"></a>
Per session 54 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,347 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00054 $0.01347
Opus 5 $0.00027 $0.00674
Sonnet 5 $0.00011 $0.00269
Haiku 4.5 $0.00005 $0.00135

Measured 4d ago against content hash 140b46dc1de5, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

database scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/database/SKILL.md · 174 lines

How it starts

The opening of the file, as written. The whole thing — 174 lines — stays where its author put it; the contents beside it link to each section on GitHub.

database

Authoritative reference for relational database work: connection pooling, async queries, migrations, and Supabase-specific patterns.

1) Async connection with asyncpg / SQLAlchemy 2

from sqlalchemy.ext.asyncio import create_async_engine, AsyncSession, async_sessionmaker

engine = create_async_engine(
    "postgresql+asyncpg://user:pass@host/db",
    pool_size=10,
    max_overflow=20,
    pool_pre_ping=True,   # drop dead connections before use
)
AsyncSessionLocal = async_sessionmaker(engine, expire_on_commit=False)

async def get_db():
    async with AsyncSessionLocal() as session:
        yield session

2) SQLAlchemy 2 Core style (preferred for high-throughput)

from sqlalchemy import select, insert, update, delete, text

# SELECT with filter
stmt = select(Article).where(Article.published == True).order_by(Article.created_at.desc()).limit(20)
result = await session.execute(stmt)
rows = result.scalars().all()

# Bulk INSERT (ignore duplicates)
stmt = insert(Keyword).values(data).on_conflict_do_nothing(index_elements=['slug'])
await session.execute(stmt)
await session.commit()

# Raw SQL (last resort — prefer Core)
result = await session.execute(text("SELECT id FROM articles WHERE slug = :s"), {"s": slug})

3) Model definition pattern

from sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column
from sqlalchemy import String, DateTime, func
import uuid

class Base(DeclarativeBase):
    pass

class Article(Base):
    __tablename__ = "articles"

    id:         Mapped[uuid.UUID]  = mapped_column(primary_key=True, default=uuid.uuid4)
    slug:       Mapped[str]        = mapped_column(String(255), unique=True, index=True)
    title:      Mapped[str]        = mapped_column(String(500))
    published:  Mapped[bool]       = mapped_column(default=False)
    created_at: Mapped[datetime]   = mapped_column(server_default=func.now())

4) Alembic migrations

# Init (once per project)
alembic init alembic

# alembic/env.py — point at your models
from app.models import Base
target_metadata = Base.metadata

# Generate migration from model diff
alembic revision --autogenerate -m "add articles table"

# Apply / rollback
alembic upgrade head
alembic downgrade -1

# Check current revision
alembic current
alembic history --verbose

Read the full file on GitHub · 174 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 174 lines · 54 tokens per session scan A 140b46dc1de5

Subscribe to this mod's changes

database is a skill published in the GitHub repository LuuOW/meridian-mcp (0 stars, last pushed 2d ago), licensed MIT. It adds 54 tokens to every session and 1,347 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

SQLAlchemy ORM Expert

Comprehensive SQLAlchemy skill for customer support tech enablement, covering ORM patterns, session management, query optimization, async operations, and PostgreSQL integration.

manutej/luxor-claude-marketplace · 34 tokens

pytest

Advanced Python unit testing framework for customer support tech enablement, covering FastAPI, SQLAlchemy, PostgreSQL, async operations, mocking, fixtures, parametrization, coverage, and comprehensive testing strategies for backend support systems.

manutej/luxor-claude-marketplace · 44 tokens

psycopg

PostgreSQL adapter for Python - customer support tech enablement for database operations, query optimization, and data management.

manutej/luxor-claude-marketplace · 22 tokens

FastAPI Customer Support Tech Enablement

Comprehensive FastAPI skill for building modern Python web APIs with focus on customer support systems, ticket management, real-time chat, and backend operations.

manutej/luxor-claude-marketplace · 36 tokens

python-backend

Production Python async patterns including asyncio TaskGroup, FastAPI dependency injection and middleware, SQLAlchemy 2.0 async sessions, and database connection pool tuning. Python 3.11+ runtime concerns such as ExceptionGroup, cancellation semantics, and session rollback. Use when building async services, wiring…

yonatangross/orchestkit · 82 tokens

code-ts

TypeScript code shape inside a well-named module — taste, not lint. Prefer one class or namespace per file (the unit a test targets) over scattered free exports; consolidate related code, don't fragment. The unit of code should be the unit of spec. Use when authoring TS in editor/grida-canvas, editor/lib/, or…

gridaco/grida · 99 tokens