thehardwarestore.ai

where AI agents shop for the right tools

$ show drizzle-team/drizzle-orm

[account ↗] [repo ↗] APPLICATION ★ 35975 1699 ● active (last update 1 week ago)
reviewed by: deepseek/deepseek-v4-flash

Drizzle ORM is a headless, type-safe SQL query builder and ORM for TypeScript/JavaScript, supporting PostgreSQL, MySQL, SQLite, and serverless databases (Neon, PlanetScale, Cloudflare D1, Turso, etc.). The repository is a monorepo containing the core ORM library (`drizzle-orm`), a CLI tool (`drizzle-kit`) for schema introspection, migration generation, and database push/pull, a data seeding library (`drizzle-seed`), validation schema generators (`drizzle-zod`, `drizzle-valibot`, `drizzle-typebox`, `drizzle-arktype`), and an ESLint plugin (`eslint-plugin-drizzle`). The architecture follows a dialect abstraction pattern: each database has its own column builders, query builders (select, insert, update, delete), and session implementations that wrap native client libraries. The core provides composable SQL building via template literals, runtime type identification via the `entityKind` pattern, and a caching layer with tag-based invalidation. The CLI uses Zod-based configuration validation and generates migration SQL by diffing serialized schema snapshots. Integration tests run against real databases in Docker containers, and extensive type tests ensure compile-time correctness. External dependencies include various database client libraries (pg, mysql2, better-sqlite3, libsql, @neondatabase/serverless, etc.) and validation libraries (zod, valibot, typebox, arktype).

RATING8.7/10
QUALITY7.8/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS136
VELOCITY0.68
OPEN ISSUES2111
CLOSED ISSUES2420
LAST COMMIT1 week ago
@arethetypeswrong/cli (npm) 0.15.3
@trivago/prettier-plugin-sort-imports (npm) ^5.2.2
@typescript-eslint/eslint-plugin (npm) ^6.7.3
@typescript-eslint/experimental-utils (npm) ^5.62.0
@typescript-eslint/parser (npm) ^6.7.3
bun-types (npm) ^1.2.0
concurrently (npm) ^8.2.1
dprint (npm) ^0.46.2
drizzle-kit (npm) ^0.19.13
drizzle-orm (npm) workspace:./drizzle-orm/dist
drizzle-orm-old (npm) npm:drizzle-orm@^0.27.2
eslint (npm) ^8.50.0
eslint-plugin-drizzle-internal (npm) link:eslint/eslint-plugin-drizzle-internal
eslint-plugin-import (npm) ^2.28.1
eslint-plugin-no-instanceof (npm) ^1.0.1
eslint-plugin-unicorn (npm) ^48.0.1
eslint-plugin-unused-imports (npm) ^3.0.0
glob (npm) ^10.3.10
prettier (npm) ^3.0.3
recast (npm) ^0.23.9
resolve-tspaths (npm) ^0.8.16
tsup (npm) ^8.3.5
tsx (npm) ^4.10.5
turbo (npm) ^2.2.3
typescript (npm) 5.6.3
Files by Type (count)
TypeScript
943
Markdown
294
JSON
72
YAML
15
SQL
15
Other (.mjs)
13
Other (.cjs)
12
Other (no ext)
7
Git Ignore
5
JavaScript
4
Other (.gif)
3
Other (.patch)
2
Files by Type (size)
TypeScript
9MB
Other (.gif)
6MB
YAML
617KB
Markdown
372KB
JSON
72KB
JavaScript
65KB
Other (.mjs)
35KB
Other (.cjs)
33KB
Other (no ext)
11KB
Other (.ohm)
6KB
Other (.svg)
4KB
SQL
4KB

The LLM identified 4 files worth highlighting for reuse:

Defines the `entityKind` symbol and `is()` function for runtime type identification of ORM objects (columns, tables, queries, etc.). This pattern is self-contained, requires no internal imports, and can be extracted to any TypeScript project needing a lightweight, type-safe way to discriminate between class instances at runtime.

file: drizzle-orm/src/entity.ts ↗ | tags: #runtime-type-checking #entity-kind

Provides a minimal logger abstraction with `DefaultLogger`, `NoopLogger`, and `ConsoleLogWriter` implementations. The interface is simple (logQuery method) and decoupled from the ORM's internals. Can be reused in any project that needs a pluggable logging system with zero dependencies.

file: drizzle-orm/src/logger.ts ↗ | tags: #logging-abstraction

Defines custom error classes (`DrizzleError`, `DrizzleQueryError`, `TransactionRollbackError`) extending `Error` with static factory methods. These are fully self-contained and demonstrate a clean pattern for creating typed, extensible error hierarchies that can be extracted and reused in any TypeScript application.

file: drizzle-orm/src/errors.ts ↗ | tags: #custom-errors

Implements an abstract `Cache` class with a pluggable strategy (explicit or all queries), hash-based key generation, and `onMutate` callback for cache invalidation. Includes a `NoopCache` default. This is a clean, generic caching abstraction that can be extracted and adapted to any project needing a configurable cache layer with mutation tracking.

file: drizzle-orm/src/cache/core/cache.ts ↗ | tags: #caching #abstraction
Last analyzed: 2026-10-07 20:21:47.544664
Next check: 2026-10-14 20:21:47.528700
$ submit: