Skip to content

Repository files navigation

drizzle-plus

npm version npm downloads License

Focused query-builder extensions and SQL helpers for Drizzle ORM.

drizzle-plus adds practical query methods such as count(), upsert(), updateMany(), and cursor pagination. It also provides typed SQL expressions for common functions, JSON aggregation, timestamps, subqueries, and more.

It supports PostgreSQL, MySQL, and SQLite. The documentation has one page for each extension and helper family, with the supported import path and a working starting example.

Install

pnpm add drizzle-plus drizzle-orm

The package targets the Drizzle ORM v1 line and declares drizzle-orm as a peer dependency. Keep both packages on compatible versions.

First extension

Query extensions are enabled with a dialect-specific side-effect import:

import 'drizzle-plus/sqlite/findManyAndCount'

const page = await db.query.user.findManyAndCount({
  where: { active: true },
  columns: { id: true, name: true },
  limit: 20,
})

page.data
page.count

Use pg, mysql, or sqlite in the import path that matches your Drizzle database. Shared SQL helpers are named imports:

import { caseWhen, upper } from 'drizzle-plus'
import { jsonAgg } from 'drizzle-plus/pg'

Feature map

Query extensions

Database and select helpers

SQL helpers and utilities

Development

pnpm test
pnpm run lint
pnpm run docs:build

Contributions are welcome. See the full documentation for feature boundaries and dialect support.

License

MIT

About

A collection of useful utilities and extensions for Drizzle ORM

Topics

Resources

Stars

169 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages