# 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): The "Overview" component serves as the structural and operational nexus for the Drizzle ecosystem, bridging the gap between high-level developer schemas and low-level database drivers. Its primary ... - [Quick Start](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/technical/getting-started/quick-start): The "Quick Start" subsystem represents the entry-point factory layer for Drizzle ORM. Its primary purpose is to provide a unified, type-safe API for initializing database connections across a diver... - [Project Structure](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/technical/getting-started/project-structure): The system project structure is defined by two primary concerns: the generation of database migration SQL via drizzle-kit and the runtime query construction via drizzle-orm. These components act as... ## Technical docs: Database Schema - [Schema Declarations](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/technical/database-schema/schema-declarations): Schema declarations in Drizzle define the structure of your database, acting as the single source of truth for the ORM. They bridge the gap between physical database tables and the TypeScript types... - [Column Types](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/technical/database-schema/column-types): Relevant source files - [Indexes and Constraints](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/technical/database-schema/indexes-and-constraints): Indexes and Constraints represent a critical abstraction layer in Drizzle Kit that bridges the gap between database schema definitions in TypeScript and the concrete implementations in target RDBMS... - [Entity Relations](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/technical/database-schema/entity-relations): Entity Relations form the core of the relational query engine in Drizzle ORM. They act as the abstraction layer that maps TypeScript schema definitions to database-level operations, enabling comple... ## Technical docs: Query Engine - [Select Queries](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/technical/query-engine/select-queries): Select queries in Drizzle ORM are responsible for transforming high-level, type-safe builder configurations into raw SQL statements appropriate for the target database dialect (PostgreSQL, MySQL, o... - [Data Mutations](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/technical/query-engine/data-mutations): Data mutations in Drizzle ORM facilitate the controlled modification of database state via INSERT, UPDATE, and DELETE operations. By decoupling query construction from execution, the system provide... - [Query Builder Core](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/technical/query-engine/query-builder-core): The "Query Builder Core" subsystem serves as the foundational abstraction layer that decouples Drizzle's expressive DSL from the myriad of underlying database drivers and execution runtimes. By pro... - [Views and Aggregates](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/technical/query-engine/views-and-aggregates): Database views act as virtual tables; in a migration-based workflow, Drizzle Kit manages their definitions and structural configuration to ensure that changes to underlying SQL can be accurately de... - [SQL Expressions](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/technical/query-engine/sql-expressions): SQL Expressions are the fundamental building blocks of Drizzle ORM's query-building system. They provide a unified, type-safe abstraction for constructing SQL queries across different database dial... ## Technical docs: Database Drivers - [Database Drivers](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/technical/database-drivers/database-drivers): Database drivers act as the fundamental bridge between Drizzle ORM and specific database engines or communication protocols. By abstracting the complexities of low-level client interactions, these ... ## Technical docs: Drizzle Kit - [Kit Overview](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/technical/drizzle-kit/kit-overview): The "Kit Overview" encompasses the core logic responsible for database introspection, snapshot management, and the generation of migration SQL. Its primary role is to bridge the gap between applica... - [Schema Introspection](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/technical/drizzle-kit/schema-introspection): Schema Introspection is the process of querying a live database to reconstruct its structure (tables, columns, constraints, indexes, and relations) into an internal representation. This subsystem a... - [Schema Serialization](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/technical/drizzle-kit/schema-serialization): Schema Serialization is the architectural backbone of Drizzle Kit, providing a deterministic mechanism to capture, persist, and compare database schema states. Its primary purpose is to enable "Dat... - [Migration Differ](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/technical/drizzle-kit/migration-differ): Migration Differ is a critical subsystem within drizzle-kit responsible for calculating the transition between two database schema snapshots. Its primary role is to ingest historical and current sc... - [CLI Commands](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/technical/drizzle-kit/cli-commands): The Drizzle Kit CLI Commands provide a bridge between local TypeScript schema definitions and remote database states. Its primary responsibility is schema reconciliation: computing the delta betwee... ## Technical docs: Schema Integrations - [Zod Validation](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/technical/schema-integrations/zod-validation): Zod Validation provides a bridge between Drizzle ORM database definitions and Zod schemas, enabling automatic generation of validation logic from table and view definitions. By introspecting the Dr... - [TypeBox Validation](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/technical/schema-integrations/typebox-validation): "TypeBox Validation" is a specialized bridge component within the Drizzle ecosystem designed to derive TypeBox schemas directly from Drizzle ORM column definitions. By leveraging the type metadata ... - [Valibot Validation](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/technical/schema-integrations/valibot-validation): "Valibot Validation" in the context of Drizzle Kit refers to the internal infrastructure responsible for introspecting database schemas and transforming that information into valid, type-safe TypeS... - [ArkType Validation](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/technical/schema-integrations/arktype-validation): ArkType Validation is a specialized integration layer within the Drizzle ecosystem designed to automatically generate high-performance runtime type validators from Drizzle database schema definitio... ## Technical docs: Seed Generators - [Seed Engine](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/technical/seed-generators/seed-engine): The "Seed Engine" is a sophisticated data generation framework integrated into the Drizzle ORM ecosystem, specifically designed to automate the population of database schemas with realistic synthet... - [Data Generators](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/technical/seed-generators/data-generators): Data Generators are the backend mechanism for producing high-quality, randomized, and schema-compliant data for database tables within the seeding process. Their primary purpose is to encapsulate t... ## Technical docs: Utilities and Testing - [ESLint Plugin](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/technical/utilities-testing/eslint-plugin): The eslint-plugin-drizzle package is a specialized linting utility designed to enforce safety patterns within Drizzle ORM query construction. Its primary purpose is to prevent common, high-risk dev... - [Query Caching](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/technical/utilities-testing/query-caching): Query Caching in Drizzle ORM provides a standardized mechanism to intercept database execution paths, checking a cache layer before executing a query against the underlying driver. This architectur... - [Integration Tests](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/technical/utilities-testing/integration-tests): Integration tests in this ecosystem serve as the primary validation layer for query builder correctness, type inference, and cross-dialect behavior. By exercising the Drizzle ORM against real-world... - [Type Safety Testing](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/technical/utilities-testing/type-safety-testing): Type safety testing is a foundational component of the Drizzle ORM architecture, designed to ensure that the abstraction layer between TypeScript code and SQL databases remains strictly typed. By u... ## Technical docs: How It Works - [SQL Alias Formatting Process](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/technical/how-it-works/sql-alias-formatting-process): The as() method in Drizzle ORM is a fundamental utility used to convert a query builder (such as a select statement) into a Subquery object, allowing the result of that query to be treated as a tab... - [SQL Alias Formatting Process](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/technical/how-it-works/sql-alias-formatting-process-2): The as to StringChunk flow is a core mechanism in Drizzle ORM that enables the conversion of a Query Builder instance into a reusable subquery. When you define a query and append .as('alias') to it... - [SQL Alias Formatting Process](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/technical/how-it-works/sql-alias-formatting-process-3): The "As -> StringChunk" flow describes how Drizzle transforms a configured query builder into a named subquery expression within a SQL statement. This process is triggered when a user calls the .as... ## User guide: Getting Started - [Installation and Setup](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/guide/getting-started/installation-and-setup): Drizzle ORM is a lightweight and flexible tool designed to help you interact with your SQL databases using TypeScript. By handling the bridge between your code and your database, it allows you to w... - [Quickstart Guide](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/guide/getting-started/quickstart-guide): Getting started with Drizzle ORM allows you to interact with your database using simple, readable commands. This guide helps you set up your database connection and perform basic operations so you ... ## User guide: Core Features - [Declaring Database Schemas](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/guide/core-features/declaring-database-schemas): Declaring your database schema allows you to define the structure of your data—such as tables, columns, and constraints—directly within your project. This approach provides a clear, type-safe bluep... - [Querying and Mutating Data](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/guide/core-features/querying-and-mutating-data): Querying and mutating data are the core operations you perform to interact with your database. Whether you need to retrieve specific information, organize results, or combine data from multiple tab... - [Defining Table Relations](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/guide/core-features/defining-table-relations): Defining table relations allows you to establish how different tables in your database are connected to one another. By explicitly linking these tables, you can easily query data across related ent... ## User guide: How-To Guides - [Managing Schema Migrations](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/guide/how-to-guides/managing-schema-migrations): Schema migrations allow you to track changes to your database structure over time and apply those changes to your live database. This is a critical process for keeping your database definition in s... - [Seeding Mock Data](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/guide/how-to-guides/seeding-mock-data): Seeding mock data allows you to fill your database with realistic, automatically generated information. This is particularly useful during the development and testing phases, as it lets you interac... - [Using Drizzle Studio](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/guide/how-to-guides/using-drizzle-studio): Drizzle Studio is a visual database manager designed to help you interact with your database directly through a web browser. It provides a user-friendly interface to view your tables, inspect data,... ## User guide: Configuration - [Configuration File Reference](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/guide/configuration/configuration-file-reference): The configuration file allows you to customize how the system interacts with your database. By creating this file, you define where your data structures are stored, where generated files should be ... ## User guide: Integrations - [Schema Validation Integrations](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/guide/integrations/schema-validation-integrations): Schema validation integrations allow you to keep your application data consistent by automatically generating validation rules based on your database structure. Instead of manually writing code to ... - [Using Third-Party Builders](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/guide/integrations/using-third-party-builders): Integrating third-party tools with your database workflow allows you to extend the capabilities of your application while keeping your data management efficient. Whether you need to handle complex ... ## User guide: Troubleshooting - [Resolving Common Errors](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/guide/troubleshooting/resolving-common-errors): Even when using robust database tools, you may occasionally encounter errors while interacting with your data. Understanding what these errors mean and how to address them helps you keep your appli... ## Optional - [Full Documentation](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/llms-full.txt): Complete documentation content in a single file