CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl-labs/drizzle-best-practices

Drizzle ORM patterns -- schema definition, indexes, relations, migrations, transactions, upserts, prepared statements, and connection setup

96

1.60x
Quality

96%

Does it follow best practices?

Impact

98%

1.60x

Average score across 5 eval scenarios

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

task.mdevals/scenario-2/

Event Ticketing Platform Schema

Problem/Feature Description

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:

  • All upcoming published events
  • All purchases for a specific event
  • A customer's purchase history with full event and ticket type details

Output Specification

Produce:

  • src/db/schema.ts -- Drizzle schema with all table definitions
  • src/db/db.ts -- Database connection setup (using better-sqlite3)
  • A brief schema-notes.md explaining your data type and design decisions

Do not generate migrations or application code -- just the schema, connection setup, and notes.

evals

tile.json