← ClaudeAtlas

rust-sqlxlisted

Durable outcome. Use when a Rust service PostgreSQL pool, DSN, transaction, commit result, repository query, migration, or database-backed test can change what is durably written, what a caller may retry, or which schema a binary carries.
Dankosik/rust-service-template-rest · ★ 0 · API & Backend · score 70
Install: claude install-skill Dankosik/rust-service-template-rest
# Rust SQLx **Durable outcome.** Every database decision is judged by what is durably written and what the caller may safely do next; a query that compiles and a test that passes without a server prove neither. Honor supplied requirements and preserve settled choices outside the requested change; resolve only what the task leaves open. Decide against the existing owners. infra_postgres::Dsn admits the one connection string and refuses what sqlx would otherwise merge: libpq environment, passfile, sockets, allow and prefer, TLS files, unknown parameters; a diagnostic names the rule, never the value. Budgets are constants in that crate (acquire, statement and idle-in-transaction session defaults, rollback, migration lock and statement, run deadline); postgres.max_connections is the only operator value. A new budget or key needs a deployment reason the persistence document records, not a convenience. The pool is opened by bootstrap when the profile is enabled, joins readiness through PostgresProbe, and closes in the dependency-close stage; an adapter never opens its own connection. Every access runs through in_tx or in_tx_with with the async closure receiving the connection, so the closure cannot commit or roll back on its own. Read the commit result exactly: CommitFailed means nothing was written and a retry is allowed; CommitUnknown means the server may have committed and the caller reconciles against the operation's own identity. retryable names serialization failures and d