Drizzle ORM: A Headless TypeScript ORM for Modern Web Development

Summary
Drizzle ORM is a modern, lightweight, and headless TypeScript ORM designed for NodeJS, TypeScript, and JavaScript environments. It offers robust support for various SQL databases, including serverless options, and emphasizes type-safety and extensibility. With over 31,000 stars, Drizzle ORM is a popular choice for developers seeking a performant and flexible solution for their data interactions.
At a glance
- Added to OSRepos
- November 25, 2025
- Last analyzed
- November 25, 2025
Topics
Click on any tag to explore related repositories
Use at your own risk
OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of code from these repositories is the user's own responsibility. Always review the repository, source code, dependencies, licenses, and security implications before running or installing anything. OSRepos is not responsible for issues, damages, or losses resulting from third-party repositories.
Introduction
Drizzle ORM is a powerful and lightweight headless ORM built for TypeScript and JavaScript. It provides a modern approach to interacting with SQL databases, focusing on performance, type-safety, and developer experience. Supporting PostgreSQL, MySQL, and SQLite, Drizzle ORM is designed to work seamlessly across various environments, including serverless functions and edge runtimes. Its zero-dependency architecture and tree-shakeable design make it an efficient choice for any project.
Installation
Getting started with Drizzle ORM is straightforward. You can install the core package using npm or yarn:
npm install drizzle-orm
# or
yarn add drizzle-orm
For database migrations and schema management, it's recommended to also install drizzle-kit:
npm install drizzle-kit
# or
yarn add drizzle-kit
Examples
Drizzle ORM allows you to define your SQL schemas using TypeScript and build both relational and SQL-like queries. Here's a basic example of defining a schema and performing a simple select query:
// schema.ts
import { pgTable, serial, text, varchar } from 'drizzle-orm/pg-core';
export const users = pgTable('users', {
id: serial('id').primaryKey(),
fullName: text('full_name'),
phone: varchar('phone', { length: 256 }),
});
// query.ts
import { eq } from 'drizzle-orm';
import { db } from './db'; // Assume db is an initialized Drizzle client
import { users } from './schema';
async function getUserById(userId: number) {
const result = await db.select().from(users).where(eq(users.id, userId));
console.log(result);
}
getUserById(1);
Why use Drizzle ORM?
Drizzle ORM stands out for several reasons:
- Lightweight and Zero Dependencies: At only ~7.4kb minified+gzipped, it's highly efficient with no external dependencies.
- Serverless-Ready: Designed to work in all major JavaScript runtimes, including NodeJS, Bun, Deno, and Cloudflare Workers, making it ideal for serverless architectures.
- Broad Database Support: Compatible with every PostgreSQL, MySQL, and SQLite database, including popular serverless providers like Turso, Neon, PlanetScale, and Vercel Postgres.
- Type-Safe and Extensible: Offers a robust TypeScript experience for declaring SQL schemas and building queries, balancing type-safety with flexibility.
- Powerful Ecosystem: Comes with
Drizzle Kitfor hassle-free migrations andDrizzle Studiofor effortless data browsing and manipulation. - Performance: Engineered for speed, allowing developers to build fast applications without introducing data proxies.
Links
Source repository
Open the original repository on GitHub.
17 counted GitHub visits
Related repositories
Similar repositories that may be relevant next.

OrcaReplay: Time Travel for AI Agents, Debugging and Evaluation
October 2, 2026
OrcaReplay introduces "time travel" capabilities for AI agents, allowing developers to record, replay, fork, and debug any agent run with any model. It addresses the challenges of AI agent debugging by providing byte-for-byte reproducibility, offline analysis, and the ability to compare different models from specific checkpoints. This tool, built by the OrcaRouter.ai team, enhances observability and control over complex agent behaviors.

OpenMake LLM: Self-Hosted AI Workspace for Local and Open-Weight LLMs
October 1, 2026
OpenMake LLM is an open-source, self-hosted AI workspace for local and open-weight LLMs. It coordinates specialized models, autonomous agents, and tools for deep research and artifact generation. This platform supports vLLM, LiteLLM, and BYOK providers, offering a robust environment for managing AI workloads.

ZenNotes: Keyboard-First Markdown Notes with Vim, Diagrams, and MCP Integration
October 1, 2026
ZenNotes is a versatile, keyboard-first Markdown notes app designed for speed and flexibility. It stores notes as plain Markdown files, offering Vim-friendly editing, diagram support, and integration with MCP tools. Available as a desktop app (Electron) and a self-hosted web app, ZenNotes provides a powerful solution for organizing your thoughts.

lat.md: A Knowledge Graph for Your Codebase, Written in Markdown
September 26, 2026
lat.md is an innovative tool that transforms your codebase knowledge into an interconnected graph of markdown files. It helps both AI agents and human developers quickly understand project architecture, business logic, and design decisions. By integrating directly into your project, lat.md ensures documentation remains consistent and up-to-date.