{
 "kind": "tool",
 "slug": "drizzle-orm",
 "path": "tools/drizzle-orm/",
 "name": "Drizzle ORM",
 "maker": null,
 "density": "profile",
 "crumbs": [
  [
   "Tools",
   "tools/"
  ],
  [
   "Databases, ORMs and clients",
   "tools/databases-orms/"
  ]
 ],
 "lead": "TypeScript ORM for SQL databases with type safety and zero-runtime overhead.",
 "chips": [
  {
   "label": "Databases, ORMs and clients",
   "path": "tools/databases-orms/"
  },
  {
   "label": "NPM"
  }
 ],
 "primary": {
  "label": "Copy install command",
  "copy": "npm install drizzle-orm"
 },
 "links": [
  {
   "label": "GitHub",
   "href": "https://github.com/drizzle-team/drizzle-orm"
  },
  {
   "label": "Website",
   "href": "https://orm.drizzle.team"
  }
 ],
 "track": "New versions, deprecation and license changes on your dashboard",
 "verdicts": [
  {
   "key": "license",
   "label": "License",
   "value": "Apache-2.0",
   "status": "yes",
   "sub": "Use it in paid apps",
   "quote": null,
   "note": "License from npm.",
   "src": "https://github.com/drizzle-team/drizzle-orm"
  },
  {
   "key": "maint",
   "label": "Maintained",
   "value": "Maintained",
   "status": "yes",
   "sub": "Last change Nov 20, 2026",
   "note": "Latest GitHub release Oct 8, 2026. ",
   "src": "https://github.com/drizzle-team/drizzle-orm"
  },
  {
   "key": "pop",
   "label": "Used by agents' projects",
   "value": "253 projects",
   "status": "info",
   "sub": "#2 of 120 in its category",
   "note": "Dependency in 253 public GitHub projects set up for AI coding agents that we scanned (4.0%).",
   "src": null
  },
  {
   "key": "agent",
   "label": "Agent access",
   "value": "Docs for agents",
   "status": "yes",
   "sub": "llms.txt",
   "note": "Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.",
   "src": "https://orm.drizzle.team/llms.txt"
  }
 ],
 "vfoot": "From the package registry and GitHub, checked daily.",
 "blocks": [
  {
   "id": "overview",
   "nav": "Overview",
   "h2": "What Drizzle ORM does",
   "parts": [
    {
     "t": "prose",
     "text": "Drizzle puts two query styles in one zero-dependency TypeScript package: a builder that mirrors SQL, and a relational Queries API that the docs say always compiles to exactly one SQL query."
    }
   ]
  },
  {
   "id": "popularity",
   "nav": "Popularity",
   "h2": "Drizzle ORM popularity",
   "parts": [
    {
     "t": "stats",
     "items": [
      {
       "n": "86",
       "of": "/ 100",
       "l": "Gid Score, #28 overall"
      },
      {
       "n": "49.6M",
       "l": "downloads a week, npm"
      },
      {
       "n": "36.4K",
       "l": "GitHub stars"
      },
      {
       "n": "253",
       "l": "agent projects use it"
      }
     ]
    },
    {
     "t": "small",
     "text": "Gid Score measures public popularity and activity, not quality.",
     "link": "How the Gid Score is calculated",
     "path": "tools/top/"
    }
   ]
  },
  {
   "id": "usage",
   "nav": "How it is used",
   "h2": "How Drizzle ORM is used",
   "parts": [
    {
     "t": "list",
     "items": [
      "Drizzle ORM is a dependency in 253 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (5.2% of the 4,867 JavaScript/TypeScript ones), #2 of 120 in databases, orms and clients.",
      "Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 831; those are left out of every share on this page.",
      "The most used alternative in our scan is Prisma (247 projects).",
      "Projects that use it most often also use Drizzle Kit (94.5%), Zod (75.5%), tsx (52.6%).",
      "It is more common in projects set up for OpenCode (7.9%) than for Gemini CLI (3.6%)."
     ]
    },
    {
     "t": "h3",
     "text": "By coding agent"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "152 projects, 4.6%",
       "v": "Claude Code",
       "path": "agents/claude-code/"
      },
      {
       "l": "112 projects, 4.6%",
       "v": "Cursor",
       "path": "agents/cursor/"
      },
      {
       "l": "112 projects, 3.7%",
       "v": "GitHub Copilot",
       "path": "agents/github-copilot/"
      },
      {
       "l": "27 projects, 7.9%",
       "v": "OpenCode",
       "path": "agents/opencode/"
      },
      {
       "l": "19 projects, 4.1%",
       "v": "OpenAI Codex",
       "path": "agents/openai-codex/"
      },
      {
       "l": "17 projects, 3.6%",
       "v": "Gemini CLI",
       "path": "agents/gemini-cli/"
      },
      {
       "l": "12 projects, 3.6%",
       "v": "OpenClaw",
       "path": "agents/openclaw/"
      },
      {
       "l": "12 projects, 4.3%",
       "v": "Devin Desktop",
       "path": "agents/devin-desktop/"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Often used with"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "In 94.5% of its projects",
       "v": "Drizzle Kit",
       "path": "tools/drizzle-kit/"
      },
      {
       "l": "In 75.5% of its projects",
       "v": "Zod",
       "path": "tools/zod/"
      },
      {
       "l": "In 52.6% of its projects",
       "v": "tsx",
       "path": "tools/tsx/"
      },
      {
       "l": "In 53.4% of its projects",
       "v": "Class Variance Authority",
       "path": "tools/class-variance-authority/"
      },
      {
       "l": "In 57.3% of its projects",
       "v": "clsx",
       "path": "tools/clsx/"
      },
      {
       "l": "In 51.8% of its projects",
       "v": "dotenv",
       "path": "tools/dotenv/"
      },
      {
       "l": "In 74.3% of its projects",
       "v": "Tailwind CSS",
       "path": "tools/tailwindcss/"
      },
      {
       "l": "In 56.9% of its projects",
       "v": "Tailwind Merge",
       "path": "tools/tailwind-merge/"
      }
     ]
    }
   ]
  },
  {
   "id": "profile",
   "nav": "Profile",
   "h2": "Drizzle ORM in practice",
   "parts": [
    {
     "t": "h3",
     "text": "Strengths"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "Queries that read like SQL",
       "v": "The docs argue that other ORMs force a \"double learning curve\" of SQL plus the framework's API. Drizzle's core builder is meant to map closely onto SQL, so joins and filters look like the SQL they produce."
      },
      {
       "l": "Nested reads in a single query",
       "v": "For relational data there is a separate Queries API that returns nested results without hand-written joins. The docs say it \"always outputs exactly 1 SQL query\". They pitch this as a fit for serverless databases where round trips cost money."
      },
      {
       "l": "Runs wherever JavaScript runs",
       "v": "The README lists Node.js, Bun, Deno, Cloudflare Workers, Supabase functions, edge runtimes and browsers. It names serverless databases such as Turso, Neon, PlanetScale and Cloudflare D1 as supported."
      },
      {
       "l": "A library, not a framework",
       "v": "The maintainers call Drizzle \"headless\". It is a library plus opt-in tools, and it is meant to fit an existing project layout rather than impose one. It talks to databases through their standard drivers."
      }
     ]
    },
    {
     "t": "h3",
     "text": "Watch out for"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "Still on 0.x, with breaking changes in minor releases",
       "v": "The latest release is 0.45.4. The site's changelog flags breaking changes in minor versions. For example, ORM v0.33.0 changed how <code>jsonb</code> is inserted with <code>postgres-js</code>."
      },
      {
       "l": "A v1 migration is coming",
       "v": "The docs navigation includes an upgrade guide from v0 to v1. A separate section covers moving the relational queries API from v1 to v2. Expect code changes when you upgrade."
      },
      {
       "l": "Team migration workflow is undocumented",
       "v": "The \"Migrations for teams\" page has no content yet. It says it is waiting on a new migrations folder structure and points to a GitHub discussion."
      }
     ]
    },
    {
     "t": "h3",
     "text": "Declare a schema, then query it two ways"
    },
    {
     "t": "tabs",
     "label": "Example",
     "items": [
      {
       "tab": "Ts",
       "code": "// manage your schema\nexport const countries = pgTable ( 'countries' , {\nid : serial () .primaryKey () ,\nname : varchar ({ length : 256 }) ,\n});\nexport const cities = pgTable ( 'cities' , {\nid : serial () .primaryKey () ,\nname : varchar ({ length : 256 }) ,\ncountryId : integer ( 'country_id' ) .references (() => countries .id) ,\n});\n\n// Access your data\nawait db\n.select ()\n.from (countries)\n.leftJoin (cities , eq ( cities .countryId , countries .id))\n.where ( eq ( countries .id , 10 ))\n\nconst result = await db . query . users .findMany ({\nwith : { posts : true } ,\n});"
      }
     ]
    }
   ]
  },
  {
   "id": "more",
   "nav": null,
   "spy_as": "profile",
   "h2": "More about Drizzle ORM",
   "parts": [
    {
     "t": "more",
     "items": [
      {
       "title": "Funding",
       "path": "tools/funding/",
       "items": [
        "GitHub Sponsors: https://github.com/drizzle-team",
        "68 GitHub sponsors"
       ]
      },
      {
       "title": "Head to head",
       "items": [
        {
         "text": "Prisma vs Drizzle ORM",
         "note": "used together in 4 projects",
         "path": "tools/compare/prisma-vs-drizzle-orm/"
        }
       ]
      },
      {
       "title": "Packages around it",
       "items": [
        "drizzle-kit: Drizzle migrations CLI",
        "zod: Schema validation",
        "tsx: TypeScript runner",
        "class-variance-authority: Component class variants",
        "clsx: Class name builder",
        "tailwind-merge: Tailwind class merging"
       ]
      },
      {
       "title": "More in Databases, ORMs and clients",
       "path": "tools/databases-orms/",
       "items": [
        {
         "text": "pg",
         "path": "tools/pg/"
        },
        {
         "text": "Drizzle Kit",
         "path": "tools/drizzle-kit/"
        },
        {
         "text": "SQLAlchemy",
         "path": "tools/sqlalchemy/"
        },
        {
         "text": "better-sqlite3",
         "path": "tools/better-sqlite3/"
        },
        {
         "text": "psycopg2",
         "path": "tools/psycopg2-binary/"
        },
        {
         "text": "Alembic",
         "path": "tools/alembic/"
        },
        {
         "text": "Neon Serverless Driver",
         "path": "tools/neondatabase/"
        },
        {
         "text": "psycopg",
         "path": "tools/psycopg/"
        }
       ]
      }
     ]
    }
   ]
  },
  {
   "id": "alternatives",
   "nav": "Alternatives",
   "h2": "Alternatives",
   "parts": [
    {
     "t": "alts",
     "items": [
      {
       "name": "Drizzle ORM",
       "me": true,
       "facts": [
        "Apache-2.0",
        "Gid 86",
        "49.6M/wk"
       ]
      },
      {
       "name": "Prisma",
       "why": "Modern ORM with intuitive schema, migrations, and type-safe database queries.",
       "path": "tools/prisma/",
       "facts": [
        "Apache-2.0",
        "Gid 64",
        "26M/wk"
       ]
      }
     ],
     "more": "Compare Drizzle ORM with another tool",
     "more_path": "tools/compare/"
    }
   ]
  },
  {
   "id": "start",
   "nav": "Get started",
   "h2": "Get started",
   "parts": [
    {
     "t": "install",
     "intro": "Install it.",
     "code": "npm install drizzle-orm"
    },
    {
     "t": "h3",
     "text": "Rules for your agent"
    },
    {
     "t": "rules",
     "label": "Paste into AGENTS.md or CLAUDE.md",
     "text": "## Drizzle ORM\n- Define and manage the database schema in TypeScript with the dialect's table helper, for example `pgTable` from `drizzle-orm/pg-core`.\n- For flat reads, joins and filters, use the SQL-like builder (`db.select().from(...).leftJoin(...).where(...)`).\n- For nested relational data, use `db.query.&lt;table&gt;.findMany({ with: { ... } })` instead of hand-built joins. The docs say it outputs exactly one SQL query.\n- Run schema changes through Drizzle Kit, which either generates SQL migration files or applies changes directly to the database.\n- For Expo SQLite, OP SQLite and React Native migrations, follow the Get Started guide. The dedicated web and mobile page is not written yet.\n- Check the installed version first. The project is on 0.x, minor releases have shipped breaking changes, and the docs have separate v0 to v1 and Relational Queries v1 to v2 guides.\n- For runtime validation, use the integrations listed under Validations in the docs (zod, valibot, typebox, arktype, effect-schema).\n"
    }
   ]
  }
 ],
 "glance": [
  [
   "Package",
   "npm drizzle-orm"
  ],
  [
   "Category",
   "Databases, ORMs and clients"
  ],
  [
   "License",
   "Apache-2.0"
  ],
  [
   "Latest version",
   "0.45.4, October 8, 2026"
  ],
  [
   "On GitHub since",
   "June 2021"
  ],
  [
   "Gid Score",
   "86.1"
  ],
  [
   "Rank in category",
   "#2 of 120"
  ],
  [
   "GitHub",
   "drizzle-team/drizzle-orm"
  ],
  [
   "Last change",
   "Nov 20, 2026"
  ]
 ],
 "good": [],
 "checked_line": "From the package registry, GitHub and our scan of public agent projects; numbers update daily.",
 "logo": "https://agentgid.com/media/avatars/drizzle-team.png"
}