dsql-on-rails

dsql-on-rails is a skill for Claude Code from sorah/config. It costs 231 tokens per session (4,290 once invoked), scanned A, original, MIT.

A guide for building, testing, and extending a Rails application on Amazon Aurora DSQL, a managed cloud database that speaks the PostgreSQL protocol. It covers the database's different transaction, authentication, schema, and testing behaviour.

In plain words
What is it for?
Use it when moving a Rails app to Aurora DSQL or changing its models, transactions, database tasks, tests, or continuous-integration setup.
Why use it?
Aurora DSQL behaves differently from ordinary PostgreSQL, so code that assumes locks, nested transactions, or reversible schema changes can fail.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions CLAUDE.md.

Part of the sorah-guides plugin — 19 skills, 3 commands, 1 agent shipped together

Good fit Use it when moving a Rails app to Aurora DSQL or changing its models, transactions, database tasks, tests, or continuous-integration setup.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/sorah/config/dsql-on-rails
View source ↗ sorah/config
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 sorah/config --skill dsql-on-rails
Clone the repo
git clone --depth 1 https://github.com/sorah/config

Made for: Claude Code.

Or install sorah-guides, the plugin that ships this one along with the rest of its 19 skills, 3 commands, 1 agent.

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 dsql-on-rails

README.md
[![agentmods](https://agentmods.dev/badge/skills/sorah/config/dsql-on-rails/github.svg)](https://agentmods.dev/skills/sorah/config/dsql-on-rails)
Your own site
<a href="https://agentmods.dev/skills/sorah/config/dsql-on-rails"><img src="https://agentmods.dev/badge/skills/sorah/config/dsql-on-rails/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 dsql-on-rails

Your own site · 80×15
<a href="https://agentmods.dev/skills/sorah/config/dsql-on-rails"><img src="https://agentmods.dev/badge/skills/sorah/config/dsql-on-rails.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 231 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,290 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.00231 $0.04290
Opus 5.5 $0.00092 $0.01716
Sonnet 5.5 $0.00046 $0.00858
Haiku 4.5 $0.00023 $0.00429

Measured 2d ago against content hash ee3c68ff55b2, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

dsql-on-rails 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 2d ago.

The scan reads SKILL.md. This mod also ships 11 executable files (references/app/models/concerns/dsql_transactionable.rb, references/config/initializers/dsql_monkey.rb, references/config/initializers/dsql_token.rb, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

claude/marketplace/plugins/sorah-guides/skills/dsql-on-rails/SKILL.md · 198 lines

How it starts

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

Rails on Aurora DSQL

How to run a Rails app on Aurora DSQL, from a production setup that also runs development, tests and CI against real DSQL clusters. Project-specific conventions (CLAUDE.md, docs/) always take priority.

  • For DSQL itself (SQL support, quotas, IAM, cluster operations), use the /dsql skill from AWS's agent-plugins (databases-on-aws).
  • Schema is managed by psqldef, so read /sorah-guides:sqldef-on-rails first. This skill replaces several of its tasks.

DSQL speaks the PostgreSQL protocol but behaves differently. Plan around these:

  • Optimistic concurrency control. There are no lock waits: a conflicting transaction fails at commit with OC000/OC001 and has to be retried.
  • No SAVEPOINT, so no nested transactions and no transactional test fixtures.
  • One DDL statement per transaction. Indexes are built asynchronously (create index async), and DDL itself causes OCC conflicts.
  • IAM authentication only. Sessions last at most one hour.
  • Some changes cannot be undone later: no ALTER COLUMN ... TYPE, no adding NOT NULL to an existing column. DROP COLUMN, defaults, DROP NOT NULL, partial and expression indexes, INCLUDE, NULLS NOT DISTINCT, json/jsonb, sequences and identity columns are supported. Check /dsql for anything newer.
  • There is no DSQL Local, so development and tests run against real clusters, and latency is what slows them down.

Reference files

references/ mirrors an app's tree. Copy the files, then replace the example.com names, the app_<name> role and the schema names.

File What it is
config/database.yml Connection settings, per-developer host and schema
config/initializers/dsql_monkey.rb Adapter patches, dsql_retryable?
config/initializers/dsql_token.rb IAM token generator for pg-aws_rds_iam, Timecop-safe
lib/dsql_host_resolver.rb Cluster, role and schema resolution for dev/test
lib/local_config_file.rb tmp/ pin files that fall back to the main checkout from a git worktree
lib/tasks/database.rake db:init, create, migrate, drop, pick_cluster, wait_for_jobs, wait_for_indexes, measure_latency, prune_ci, agent_user
script/pdsql psql, psqldef or any libpq tool with a fresh IAM token (chmod +x)
app/models/concerns/dsql_transactionable.rb retryable_transaction / non_idempotent_transaction
rubocop/transaction_occ_awareness.rb Cop flagging bare transaction / with_lock
spec/support/*.rb, db/schema/test_dsql_conflicts.sql RSpec setup (see Tests)

Read the full file on GitHub · 198 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. 2d ago First seen · 198 lines · 231 tokens per session scan A ee3c68ff55b2

Subscribe to this mod's changes

dsql-on-rails is a skill published in the GitHub repository sorah/config (31 stars, last pushed yesterday), licensed MIT. It adds 231 tokens to every session and 4,290 once invoked, about $0.0009 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-10-21.

Related

Other skills, from other repositories

db-migration-mysql-postgres

Migrate a Ruby on Rails application's primary database from MySQL to PostgreSQL — schema upgrades (JSON to JSONB for queryability, ENUMs to native types or check constraints, TINYINT to BOOLEAN, case-sensitivity changes), data export/import via pgloader, the dual-write cutover pattern, the gem switch (mysql2/trilogy…

sandeepmvl/rails-skills · 127 tokens

azure-resource-manager-postgresql-dotnet

Azure PostgreSQL Flexible Server SDK for .NET. Database management for PostgreSQL Flexible Server deployments. Use for creating servers, databases, firewall rules, configurations, backups, and high availability. Triggers: "PostgreSQL", "PostgreSqlFlexibleServer", "PostgreSQL Flexible Server", "Azure Database for…

microsoft/skills · 97 tokens

jpa-patterns

JPA/Hibernate patterns and common pitfalls (N+1, lazy loading, transactions, queries). Use when user has JPA performance issues, LazyInitializationException, or asks about entity relationships and fetching strategies.

piomin/claude-ai-spring-boot · 47 tokens

ecto-patterns

Use when a task touches Ecto, even a how-to question: schemas, changesets, validations, queries, preloads, Multi, migrations, constraints, money fields. Load it before writing Ecto code. Skip for Ash.

oliver-kriska/claude-elixir-phoenix · 51 tokens

kysely

Guidelines for developing with Kysely, a type-safe TypeScript SQL query builder with autocompletion support.

Mindrally/skills · 26 tokens

sql-query-performance

Use when writing or changing a query against PostgreSQL from Go — avoiding N+1 loops, reading EXPLAIN output, indexing, and keyset pagination.

makifbaysal/tasktrooper · 35 tokens