npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@react-querybuilder/drizzle

v8.14.0

Published

Drizzle ORM integration for React Query Builder

Readme

@react-querybuilder/drizzle

Augments react-querybuilder with Drizzle ORM integration.

Full documentation

[!TIP]

This package is unnecessary, and only supports Drizzle's query builder API (like db.select().from(table).where(...)) anyway.

Recommended alternatives

For Drizzle's relational queries API, use formatQuery from react-querybuilder with the "drizzle" format. Assign the result to the where property of .findMany() or a related function, like so:

import { formatQuery } from 'react-querybuilder/formatQuery';
const where = formatQuery(query, 'drizzle');
const results = db.query.myTable.findMany({ where });

For Drizzle's query builder API, use the "drizzle" format in the same way as above and then pass a table definition and Drizzle operators into the generated function. Pass the result of that call to .where(), like so:

import { getOperators } from 'drizzle-orm';
import { drizzle } from 'drizzle-orm/bun-sqlite';
import { sqliteTable, text } from 'drizzle-orm/sqlite-core';
import { formatQuery } from 'react-querybuilder/formatQuery';

const db = drizzle(process.env.DB_FILE_NAME!);
const table = sqliteTable('musicians', {
  firstName: text(),
  lastName: text(),
});

const whereFn = formatQuery(query, 'drizzle');
const whereObj = whereFn(table, getOperators());
const results = db.select().from(table).where(whereObj);

Installation

npm i react-querybuilder @react-querybuilder/drizzle
# OR yarn add / pnpm add / bun add

Usage

To produce a Drizzle query based on a React Query Builder query object, first generate a rule group processor with generateDrizzleRuleGroupProcessor using your table config (or a plain object mapping field names to Drizzle Columns). Then run formatQuery, assigning your rule group processor as ruleGroupProcessor.

import { formatQuery } from 'react-querybuilder';
import { generateDrizzleRuleGroupProcessor } from '@react-querybuilder/drizzle';
import { drizzle } from 'drizzle-orm/bun-sqlite';
import { sqliteTable } from 'drizzle-orm/sqlite-core';
import { fields } from './fields';

const db = drizzle(process.env.DB_FILE_NAME!);

const table = sqliteTable('table', {
  firstName: text(),
  lastName: text(),
});

const ruleGroupProcessor = generateDrizzleRuleGroupProcessor(table);

const sqlWhere = formatQuery(query, { fields, ruleGroupProcessor });

const results = db.select().from(table).where(sqlWhere);