rc-sqlx

rc-sqlx is a skill for Claude Code 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 Code

Written for Claude Code: user-invocable in frontmatter. Also seen: model in frontmatter; positional $N argument.

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

Good fit 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.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/rodolfochicone/rc-project/rc-sqlx
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.

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.

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/github.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/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for rc-sqlx

Your own site · 80×15
<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="Reviewed on agentmods" width="80" 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. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00094 $0.00734
Opus 5.5 $0.00038 $0.00294
Sonnet 5.5 $0.00019 $0.00147
Haiku 4.5 $0.00009 $0.00073

Measured 1mo ago against content hash 157a4aaa53e5, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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. Mapping — query_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. Test — sqlx::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. 1mo 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 2mo ago), licensed MIT. It adds 94 tokens to every session and 734 once invoked, about $0.0004 per session on Opus 5.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

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

golem-add-postgres-rust

Using golem:rdbms/postgres from a Rust Golem agent. Use when the user asks to connect to PostgreSQL, run SQL, execute a Postgres transaction, or use PostgreSQL from Rust agent code.

golemcloud/golem · 52 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

sea-orm

SeaORM v2 (open-source, Postgres/MySQL/SQLite) and SeaORM-X (commercial MSSQL) patterns for Rust backends. Use when: adding SeaORM to a project, writing migrations, generating entities, performing CRUD (insert, select, update, delete), paginating results, loading relations, handling on-conflict, using the v2…

pedromneto97/custom-skills · 110 tokens

rust-patterns

Idiomatic Rust patterns, ownership, error handling, traits, concurrency, and best practices for building safe, performant applications.

affaan-m/ECC · 28 tokens

jpa-patterns

JPA/Hibernate patterns for entity design, relationships, query optimization, transactions, auditing, indexing, pagination, and pooling in Spring Boot.

affaan-m/ECC · 33 tokens