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 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:
The team wants the full database setup: schema, connection, migration tooling, and a few starter queries to validate everything works:
Produce:
src/db/schema.ts -- Full Drizzle schemasrc/db/db.ts -- Database connection with postgres.jsdrizzle.config.ts -- drizzle-kit configuration for PostgreSQLsrc/db/queries.ts -- The three starter query/mutation functionssetup-guide.md -- Brief instructions for getting the database running (connection, migrations)