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
Relations defined for all FK tables
0%
100%
Query API used for nested data
0%
100%
Operator helpers for all conditions
100%
100%
desc/asc helpers for ordering
100%
100%
Indexes on FK columns
0%
100%
Indexes on filtered columns
0%
100%
drizzle.config.ts uses dialect
100%
100%
defineConfig import
0%
100%
Generate command is current
100%
100%
Migrate command is current
100%
100%
Schema passed to drizzle
100%
100%
Enum for post status
100%
100%
Migrations committed note
100%
100%
Indexes on FK columns
0%
100%
Indexes on filtered columns
0%
100%
References with onDelete
100%
100%
Money as integer cents
0%
100%
Enum via text with enum option
100%
100%
createdAt on all tables
71%
100%
updatedAt on all mutable tables
62%
100%
Relations defined
100%
100%
Schema passed to drizzle
100%
100%
SQLite foreign_keys pragma
100%
100%
SQLite WAL mode
100%
100%
notNull on required columns
100%
100%
Upsert with onConflictDoUpdate
44%
100%
No check-then-insert pattern
100%
100%
Transaction wraps the entire sync
100%
100%
Uses tx inside transaction
0%
100%
updatedAt uses SQL expression
100%
100%
Batch processing for efficiency
0%
100%
excluded reference in set clause
100%
100%
Money stored as integer cents
100%
100%
Return value from transaction
100%
100%
Type inference or explicit types
80%
80%
postgres.js pool configuration
0%
100%
DATABASE_URL from environment
100%
100%
Schema passed to drizzle
100%
100%
drizzle.config.ts uses dialect
100%
100%
defineConfig used
0%
100%
Generate command current syntax
100%
100%
Migrate command present
100%
100%
Indexes on FK columns
0%
100%
Money as integer cents
0%
0%
Relations defined
100%
100%
Enum for status fields
100%
100%
Timestamps with defaultNow
100%
100%
Operator helpers for conditions
100%
100%
References with onDelete
100%
100%
Transaction for billing cycle
100%
100%
Transaction for cancel+invoice
100%
100%
Uses tx not db inside transaction
100%
100%
Returning destructured as array
0%
100%
Batch insert for invoices
0%
100%
updatedAt SQL expression on updates
0%
100%
InferSelectModel or InferInsertModel used
75%
100%
Money as integer cents
0%
100%
Indexes on FK columns
0%
100%
References with onDelete
0%
100%
Enum for status fields
100%
100%
Operator helpers for conditions
100%
100%