# blade47/drizzle-orm > AI-generated documentation for github.com/blade47/drizzle-orm ## Technical docs: Getting Started - [Overview](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/technical/getting-started/overview): Drizzle ORM is a lightweight, high-performance, TypeScript-first database toolkit engineered with a headless architecture that decouples declarative schema definitions and query building logic from... - [Quick Start](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/technical/getting-started/quick-start): Get up and running with Drizzle ORM Overview by connecting schema definitions, driver initialization, and query execution across multiple database engines. This guide provides a foundational walkth... - [Project Structure](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/technical/getting-started/project-structure): Drizzle ORM and its tooling ecosystem are structured as an integrated monorepo workspace containing packages such as drizzle-orm, drizzle-kit, validation companions (drizzle-zod, drizzle-typebox, d... ## Technical docs: Core Architecture - [SQL Template Engine](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/technical/core-architecture/sql-template-engine): The SQL template engine in Drizzle ORM provides a powerful programmatic foundation for constructing typesafe SQL queries, expressions, and database operations through tagged template literals and a... - [Table and Column Models](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/technical/core-architecture/table-and-column-models): Table and Column Models supply the core structural foundation for defining database entities, column definitions, and schema metadata across all supported dialects. They provide the base abstractio... - [Relational Query Engine](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/technical/core-architecture/relational-query-engine): The Relational Query Engine serves as Drizzle's high-level declarative query layer, translating nested TypeScript query definitions into optimized, dialect-specific SQL execution plans across multi... - [Query Builder Foundation](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/technical/core-architecture/query-builder-foundation): The Query Builder Foundation defines the architectural and type-level framework for constructing, composing, and executing declarative SQL queries across all supported database dialects. It centers... - [Sessions and Transactions](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/technical/core-architecture/sessions-and-transactions): Sessions and transactions form the execution layer that bridges high-level query builders and low-level database drivers across diverse relational dialects and runtimes. By defining unified session... - [Query Caching](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/technical/core-architecture/query-caching): Query caching in Drizzle provides an extensible caching infrastructure designed to intercept database execution, minimize redundant round-trips, and maintain synchronization between cached query re... - [Logging and Tracing](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/technical/core-architecture/logging-and-tracing): Drizzle ORM provides an integrated diagnostic infrastructure combining OpenTelemetry tracing and structured query logging to observe and monitor query execution lifecycle events. The tracing subsys... ## Technical docs: Dialects & Schemas - [Dialects And Schema Schema Definition](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/technical/dialects-and-schema/dialects-and-schema-schema-definition): The schema definition layer in Drizzle ORM provides a type-safe, declarative abstraction for structuring database tables, columns, constraints, indexes, sequences, and security primitives across di... - [Dialects And Schema Query Builders](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/technical/dialects-and-schema/dialects-and-schema-query-builders): The Drizzle ORM query building architecture relies on dialect-specific compiler components coupled with fluent query builder classes to transform high-level method chains into parameterized SQL AST... ## Technical docs: Driver Adapters - [Drivers And Runtimes](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/technical/drivers-and-runtimes/drivers-and-runtimes): The Drizzle ORM driver and runtime subsystem abstracts database communication across diverse connection models, ranging from traditional persistent TCP socket pools in Node.js to connectionless HTT... - [Edge and Mobile SQLite](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/technical/drivers-and-runtimes/edge-and-mobile-sqlite): Drizzle ORM provides dedicated driver integrations and session handlers for running SQLite databases across edge runtimes, serverless workers, WebAssembly environments, and native mobile applicatio... - [Knex Kysely and Prisma Interop](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/technical/drivers-and-runtimes/knex-kysely-and-prisma-interop): The Prisma interop layer bridges Drizzle's query builder and schema definitions with Prisma Client across PostgreSQL, MySQL, and SQLite dialects. By defining Prisma extensions with $drizzle, Drizzl... ## Technical docs: Drizzle Kit - [CLI Command Architecture](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/technical/migration-toolkit/cli-command-architecture): The CLI command architecture of drizzle-kit orchestrates schema migrations, database introspection, direct synchronization, and local environment execution by wiring command definitions, argument p... - [Migration Toolkit Schema](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/technical/migration-toolkit/migration-toolkit-schema): The Migration Toolkit Schema subsystem forms the structural bridge between user-defined TypeScript database layouts in Drizzle ORM and physical database state. It operates across multiple target di... - [Database Introspection](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/technical/migration-toolkit/database-introspection): Database introspection in Drizzle Kit recovers relational database schemas from live database instances across multiple supported dialects, normalizing catalog metadata into structured JSON migrati... - [Studio Server Bridge](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/technical/migration-toolkit/studio-server-bridge): Drizzle Studio provides an interactive web-based interface for exploring and modifying database contents via the drizzle-kit studio command. The CLI Command Architecture parses parameters and valid... - [Configuration and Validations](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/technical/migration-toolkit/configuration-and-validations): Configuration and Validations provides the schema definitions, parsing routines, and validation rules that govern drizzle.config.ts loading and command-line options across supported database engine... ## Technical docs: Ecosystem Packages - [Drizzle Zod Integration](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/technical/ecosystem-packages/drizzle-zod-integration): Drizzle Zod Integration automatically generates modular Zod validation schemas directly from Drizzle ORM table and view definitions, bridging database schema declarations with runtime input validat... - [Drizzle TypeBox Integration](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/technical/ecosystem-packages/drizzle-typebox-integration): Drizzle TypeBox Integration automates the creation of runtime validation schemas directly from Drizzle ORM table and view definitions using the TypeBox library. By translating database columns, nul... - [Drizzle Valibot Integration](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/technical/ecosystem-packages/drizzle-valibot-integration): Drizzle Valibot Integration translates Drizzle ORM table definitions, database views, and column specifications into corresponding Valibot runtime validation schemas. It provides factory functions ... - [Drizzle ArkType Integration](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/technical/ecosystem-packages/drizzle-arktype-integration): Drizzle ArkType Integration bridges Drizzle ORM definitions with the ArkType validation library by automatically generating runtime type validators and static TypeScript types from database schemas... - [Seed Service Engine](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/technical/ecosystem-packages/seed-service-engine): The seed service engine is a deterministic test data generation framework built into Drizzle ORM that populates database tables with realistic mock data, handles schema introspection, and executes ... - [Seed Data Generators](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/technical/ecosystem-packages/seed-data-generators): Seed data generators power the Seed Service Engine by programmatically constructing typed mock values for database columns across PostgreSQL, MySQL, and SQLite. Built upon a unified class architect... - [ESLint Plugin Drizzle](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/technical/ecosystem-packages/eslint-plugin-drizzle): The eslint-plugin-drizzle package provides static analysis rules for Drizzle ORM to prevent destructive, accidental database modifications during development. It exposes rule modules for enforcing ... ## Technical docs: Testing & Builds - [Monorepo Build Pipeline](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/technical/testing-and-tooling/monorepo-build-pipeline): The monorepo build pipeline coordinates task execution, multi-entry compilation, bundling, and distribution packaging across packages like drizzle-orm, drizzle-kit, drizzle-seed, and schema validat... - [Integration Test Harness](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/technical/testing-and-tooling/integration-test-harness): The integration test harness coordinates multi-dialect validation suites across local environments and continuous integration pipelines, verifying database driver behavior, schema migrations, and q... - [Type System Verification](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/technical/testing-and-tooling/type-system-verification): Type system verification validates compile-time correctness across Drizzle's table definitions, query builders, and database drivers. It uses assertion utilities such as Expect and Equal to verify ... ## Technical docs: How It Works - [Database Migration Query Merger](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/technical/how-it-works/database-migration-query-merger): The Migrate -> MergeQueries execution flow represents the end-to-end lifecycle of schema migration execution within Drizzle ORM's PostgreSQL and Netlify Database adapters. When a user triggers data... ## Technical docs: Database Schema - [Column Types](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/technical/database-schema/column-types): Relevant source files ## User guide: Getting Started - [Quickstart Guide](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/guide/getting-started/quickstart-guide): The Quickstart Guide helps you get up and running with Drizzle ORM by setting up your project, installing the necessary packages, and establishing your first database connection. Drizzle ORM connec... - [Connecting Databases](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/guide/getting-started/connecting-databases): To start querying and managing your database with Drizzle ORM, you need to connect it using a driver. Drizzle supports a wide variety of relational databases — including PostgreSQL, MySQL, SQLite, ... ## User guide: Core Features - [Declaring Schemas](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/guide/core-features/declaring-schemas): Defining database schemas in TypeScript allows you to structure your tables, columns, primary keys, indexes, and constraints with full type safety. By declaring your schema using table functions, y... - [Querying Records](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/guide/core-features/querying-records): Querying records allows you to select, filter, sort, join, and aggregate data from your database using a fluent, SQL-like syntax directly in TypeScript. Drizzle provides powerful query builders tha... - [Relational Queries](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/guide/core-features/relational-queries): Relational Queries allow you to fetch nested relations and related records in a structured, hierarchical format without writing manual SQL JOIN statements. Instead of manually stitching together ro... - [Modifying Data](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/guide/core-features/modifying-data): Modifying data involves inserting, updating, upserting, and deleting records across database tables. You can perform these operations safely and expressively using type-safe query builders across P... ## User guide: How-To Guides - [Managing Migrations](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/guide/how-to-guides/managing-migrations): Managing migrations allows you to safely evolve your database schema as your application changes. Drizzle Kit handles the process of inspecting your code-defined schema, comparing it to previous ve... - [Introspecting Databases](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/guide/how-to-guides/introspecting-databases): Database introspection inspects an existing database structure and automatically generates corresponding TypeScript schema and relation code for your project. This saves you from writing schema def... - [Custom Column Types](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/guide/how-to-guides/custom-column-types): Sometimes your application needs to store data types that are specific to your business logic or not natively supported out of the box. Custom Column Types let you define your own data types and ma... ## User guide: Configuration - [Configuring Drizzle Kit](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/guide/configuration/configuring-drizzle-kit): Configuring Drizzle Kit allows you to define how database commands—such as generating migrations, pushing schema updates, and running Drizzle Studio—interact with your database. By setting up a con... ## User guide: Integrations - [Schema Validation](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/guide/integrations/schema-validation): Schema validation allows you to automatically generate validation rules and types from your database table definitions. Instead of manually writing validation code for inserts, updates, and data qu... - [Seeding Test Data](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/guide/integrations/seeding-test-data): Populating your database with realistic dummy data for testing and development is easy using the built-in seeding tools. Instead of writing manual insert scripts, you can automatically generate row... ## User guide: Troubleshooting - [Common Troubleshooting](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/guide/troubleshooting/common-troubleshooting): When working with database schemas, migrations, and connectivity, you may occasionally run into issues such as snapshot collisions, out-of-date migration formats, connection configuration problems,... ## Optional - [Full Documentation](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/llms-full.txt): Complete documentation content in a single file