Prerequisites
CockroachDB is compatible with the PostgreSQL wire protocol. Existing drivers and ORMs work with minimal change.
1. Start a cluster
Local, single node (development):cockroach sql --insecure -e "SELECT 1" prints 1. The DB Console is at http://localhost:8080.
[!NOTE] Other targetscockroach demostarts a temporary in-memory cluster for evaluating SQL. For a managed cluster, setDATABASE_URLto a CockroachDB Cloud connection string. The schema and application are identical.
2. Create the database
SHOW DATABASES; lists ordermgmt.
3. Apply the schema
The reference implementation defines the schema inreference/schema.sql, which is the authoritative contract for the data model (see Data model). It includes Row-Level TTL on the reservations, idempotency, and outbox tables.
4. Seed data
SELECT count(*) FROM inventory; returns the seeded SKUs. SKU-HOT is seeded with on_hand = 1 for the oversell test.
5. Run the reference implementation
The reference handlers and tests read one environment variable:6. Check the accounting invariants
agent-demo/ app (cd agent-demo && npm install && npm start).
