React SQL Query Builder is a React-based component for building SQL query conditions via a visual rule tree. Version 4.2.0 provides a simple API to initialize a query builder with rules, fields, and operators, generating SQL WHERE clauses. It is not a managed UI component but rather uses imperative initialization with a DOM ID. The library is lightweight with no external dependencies, but lacks TypeScript definitions, ESM support, and active maintenance (last release over 2 years ago). It competes with react-querybuilder but offers a simpler tree-based rule structure, though with less flexibility and community support.
npm install react-sql-query-builderNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to import QueryBuilder, define rules/fields/operators, and initialize the builder on a DOM element.
Ensure the target element exists in the DOM before calling queryBuilder.init().
Use new QueryBuilder() and call init() instead of trying to use <QueryBuilder /> as a JSX component.
Consider migrating to react-querybuilder or another actively maintained alternative.
Ensure operator IDs match the predefined set (1-12).
Always pass primitive values for rule values.
Correct import: import { QueryBuilder } from 'react-sql-query-builder'; const qb = new QueryBuilder(); qb.init({...});Do not import or use as JSX; use new QueryBuilder() and .init() instead.
Ensure the element is present (e.g., after render) before calling init().
Run npm install react-sql-query-builder and use correct import path.
No dependency data recorded yet.