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-4/

Project Tracker Database Setup

Problem/Feature Description

A small agency is starting a project tracking tool. The team has decided on TypeScript with Drizzle ORM and PostgreSQL (using postgres.js as the driver). The PostgreSQL database URL will come from a DATABASE_URL environment variable.

The tool needs to manage:

  • Projects -- name, description, status (active, completed, on_hold, archived), budget in dollars
  • Team members -- name, email (unique), role
  • Tasks -- title, description, assigned to a team member, belongs to a project, status (todo, in_progress, review, done), estimated hours, actual hours
  • Time entries -- logged by a team member against a task, duration in minutes, a note about what was done

The team wants the full database setup: schema, connection, migration tooling, and a few starter queries to validate everything works:

  1. Get all active projects with their task counts
  2. Get a project with all its tasks and assigned team members
  3. Log a time entry for a task

Output Specification

Produce:

  • src/db/schema.ts -- Full Drizzle schema
  • src/db/db.ts -- Database connection with postgres.js
  • drizzle.config.ts -- drizzle-kit configuration for PostgreSQL
  • src/db/queries.ts -- The three starter query/mutation functions
  • setup-guide.md -- Brief instructions for getting the database running (connection, migrations)

evals

tile.json