rc-sqlx

rc-sqlx is a skill for Claude Code, Codex from rodolfochicone/rc-project. It costs 94 tokens per session (734 once invoked), scanned A, original, MIT.

A guide for using SQLx, a Rust library for sending SQL queries to PostgreSQL databases. It covers connection pools, typed query results, transactions, schema migrations, and database tests.

In plain words
What is it for?
Writing or reviewing Rust code that reads and writes PostgreSQL data with SQLx 0.8 or newer. It also covers connection setup, compile-time query checks, migrations, security, and integration tests.
Why use it?
It helps keep database access safe and consistent by requiring bound parameters, managed schema changes, controlled transactions, and suitable tests.

Skill for Claude CodeCodex

Part of the rc plugin — 32 skills, 2 commands, 4 agents, 5 hooks shipped together

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/rodolfochicone/rc-project/rc-sqlx
Any agent
npx skills add rodolfochicone/rc-project --skill rc-sqlx
Clone the repo
git clone --depth 1 https://github.com/rodolfochicone/rc-project

Made for: Claude Code, Codex.

Or install rc, the plugin that ships this one along with the rest of its 32 skills, 2 commands, 4 agents, 5 hooks.

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 rc-sqlx

README.md
[![agentmods](https://agentmods.dev/badge/skills/rodolfochicone/rc-project/rc-sqlx.svg)](https://agentmods.dev/skills/rodolfochicone/rc-project/rc-sqlx)
Your own site
<a href="https://agentmods.dev/skills/rodolfochicone/rc-project/rc-sqlx"><img src="https://agentmods.dev/badge/skills/rodolfochicone/rc-project/rc-sqlx.svg" alt="Measured on agentmods" height="20"></a>
Per session 94 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 734 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.00094 $0.00734
Opus 5 $0.00047 $0.00367
Sonnet 5 $0.00019 $0.00147
Haiku 4.5 $0.00009 $0.00073

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

Security

Grade A, and why

rc-sqlx 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/stacks/rc-sqlx/SKILL.md · 60 lines

How it starts

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

SQLx 0.8 + PostgreSQL

Async SQL for Rust without a heavy ORM. Target: sqlx 0.8.x, PostgreSQL 16 (compatible with 14+). Complements rc-sql (general SQL design) and rc-axum (HTTP layer).

Core workflow

  1. Schema first — migrations under version control; no ad-hoc prod DDL from app code without a migration path.
  2. Pool — one PgPool in app state; tune max_connections to VPS/DB limits.
  3. Queries — always bind parameters ($1, $2); never format! user input into SQL.
  4. Mappingquery_as / FromRow or compile-time query_as! when DATABASE_URL is available at build.
  5. Transactions — multi-step writes use pool.begin() → commit/rollback.
  6. Security — least-privilege DB role; secrets only in env. Read references/security.md.
  7. Testsqlx::test or isolated DB. Read references/testing.md.

Reference guide

Topic File Load when
Pool, query_as, transactions, macros references/guide.md Implementing queries
Injection, roles, secrets references/security.md Reviewing data access
Migrations (sqlx-cli / embed) references/migrations.md Schema changes
Integration tests references/testing.md DB tests

Must do

  • Use bound parameters for all dynamic values (Postgres $n).
  • Prefer query_as::<_, T> or query_as! into serde/FromRow structs.
  • Set pool size consciously (small VPS: start with 5–10).
  • Run migrations in deploy pipeline before app start (or controlled startup migrate).
  • Map sqlx::Error to domain/HTTP errors without leaking SQL internals to clients.

Must not do

  • Share one long-lived transaction across HTTP requests.
  • Use the superuser role for the app in production.
  • Commit migrations that are not reversible or documented when data loss is possible.
  • Ignore offline mode needs for CI (SQLX_OFFLINE=true + .sqlx data) if using macros without a live DB.

Output template

  1. Migration SQL (up, and down if required)
  2. Rust types (FromRow / domain models)
  3. Query functions (pool/tx receiver)
  4. Error mapping
  5. Tests + cargo test / sqlx prepare notes

Read the full file on GitHub · 60 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 · 60 lines · 94 tokens per session scan A 157a4aaa53e5

Subscribe to this mod's changes

rc-sqlx is a skill published in the GitHub repository rodolfochicone/rc-project (19 stars, last pushed 28d ago), licensed MIT. It adds 94 tokens to every session and 734 once invoked, about $0.0005 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-30.

Related

Other skills, from other repositories

alembic-migration

Create, review, and apply database schema changes with Alembic. Use whenever a SQLAlchemy model is added or changed, a column/index/constraint needs to change, or a data backfill is required — anything that alters the PostgreSQL schema.

vstorm-co/full-stack-ai-agent-template · 56 tokens

postgresql-table-design

Design a PostgreSQL-specific schema. Covers best-practices, data types, indexing, constraints, performance patterns, and advanced features.

BidingCC/BuildingAI · 31 tokens

database-schema-changes

Guide for making database schema changes in Platypus using Drizzle ORM — editing the schema, pushing to a dev database, and generating the migration that ships.

willdady/platypus · 37 tokens

database

Query and manage SQLite, PostgreSQL, and MySQL databases from the command line. Use when the user asks to run SQL queries, inspect database schemas, create or alter tables, import or export data, manage indexes, analyze query performance with EXPLAIN, back up or restore databases, or perform CRUD operations via…

bug-ops/zeph · 76 tokens

kverus-common-sync

Check whether the installed kverus-common skill stays synchronized with the local Verus guide under database/verified/code/tools/verus/source/docs/guide/src. Use when validating kverus-common after guide updates, before committing skill changes, or when checking for stale guide-derived references and missing source…

asterinas/KVerus · 69 tokens

cli-forge-data

Design and implement safe PostgreSQL database changes for Rust/SQLx applications. Use for new schemas, migrations, constraints, indexes, repositories, transaction boundaries, state machines, idempotency, concurrency control, queues, multi-tenancy, soft deletion, ledgers, outbox/inbox, repair jobs, or corrections…

Destynova2/cli-code-skills · 76 tokens