Drizzle ORM patterns -- schema definition, indexes, relations, migrations, transactions, upserts, prepared statements, and connection setup
96
96%
Does it follow best practices?
Impact
98%
1.60xAverage score across 5 eval scenarios
Passed
No known issues
A local venue is building a ticketing platform for concerts and theater shows. The backend is TypeScript with Drizzle ORM and SQLite. The system needs to track events (name, date, venue, capacity), ticket types for each event (e.g., VIP, General Admission -- each with a different price), and purchases (who bought which tickets, when, and how many).
Events move through stages: draft, published, sold_out, cancelled, completed. Purchases can be confirmed, refunded, or disputed.
The venue owner wants to be able to quickly look up:
Produce:
src/db/schema.ts -- Drizzle schema with all table definitionssrc/db/db.ts -- Database connection setup (using better-sqlite3)schema-notes.md explaining your data type and design decisionsDo not generate migrations or application code -- just the schema, connection setup, and notes.