database-testing

Writes and runs SQL-backed tests asserting row counts, cell values, and transaction behavior via the Steps API.

5|2|Updated May 19, 2026
One-click install
npx skills add https://github.com/civitas-cerebrum/achilles --skill database-testing-civitas-cerebrum
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-testing
Source: https://github.com/civitas-cerebrum/achilles/tree/main/skills/database-testing
Command: npx skills add https://github.com/civitas-cerebrum/achilles --skill database-testing-civitas-cerebrum

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @civitas-cerebrum/element-interactions.

What problem does it solve? UI and API tests can pass even when the underlying database write silently regresses. This Skill closes that gap by treating the database as a verifiable oracle, generating structured SQL assertions that prove mutations actually persisted. ## Core Features & Use Cases - Schema Discovery: Introspects information_schema to map tables, columns, and foreign keys, then derives CRUD, JOIN, aggregate, and transaction test scenarios automatically. - Structured Assertions: Governs the steps.sqlQuery/sqlExecute/sqlTransaction methods and verifySql* matchers (row counts, cell values, column order, empty/non-empty results) from @civitas-cerebrum/element-interactions. - DB-as-Oracle Bridge: Adds persistence assertions after UI flows or API calls, verifying that actions like checkout actually wrote the expected order row. - Use Case: After an API test creates an order, query the orders table and assert the latest row has status COMPLETED, catching write regressions the 201 response alone would miss. ## Quick Start Ask the agent to write database tests that verify the orders table after each checkout flow using steps.sqlQuery and verifySqlValue.

Frequently Asked Questions about database-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write database tests with the Steps API?

Use steps.sqlQuery for parametrised SELECTs, steps.sqlExecute for INSERT/UPDATE/DELETE, and steps.sqlTransaction for atomic multi-write operations. Assert results with verifySqlRowCount, verifySqlValue, verifySqlContains, and verifySqlColumn matchers.

How do I verify a UI action saved data to the database?

After the UI or API action, run steps.sqlQuery against the affected table and assert the persisted state, for example checking the latest order row has status COMPLETED with verifySqlValue. This proves the write landed beyond what a toast or 201 response shows.

Which SQL drivers does element-interactions support?

The framework bundles no drivers; install the one matching your dbUrl scheme: pg for postgres, mysql2 for mysql/mariadb, better-sqlite3 for sqlite, mssql for SQL Server, or oracledb for Oracle. Missing drivers throw UnsupportedEngineException.

Why do steps.sqlQuery calls fail with the method missing?

The steps.sql* surface ships in @civitas-cerebrum/element-interactions version 0.3.7 or later. Check the installed version in package.json and upgrade; do not fall back to raw pg or mysql clients, which bypass provider routing and assertions.

Can I run these database tests against production?

No. The skill explicitly restricts testing to local, staging, or sandbox databases with a known connection string in an environment variable. Tests must clean up mutations so specs remain rerunnable and never pollute shared data.

When should I not use database testing with the Steps API?

Avoid it for schema migrations, DDL or drift detection, ORM unit testing, and load or performance testing. Those belong in the app's migration tooling, the service's own suite, or dedicated performance tools.