tools

RAQB tree to SQL converter

Paste a react-awesome-query-builder tree (Utils.getTree output) and export it to SQL, MongoDB or JsonLogic, no RAQB config needed.

  • free
  • no sign-up
  • runs in your browser
  • MIT
input · react-awesome-query-builder tree
5 rules · 5 fields · converted Runs in your browser: nothing leaves it.

How it converts

RAQB's own exporters need its config to run. The raqb codec reads the tree directly: groups and their conjunctions, NOT, rule_group array conditions (some, all, none and counts), multiselect operators, BasicFuncs such as LOWER and NOW, and locked rules.

Children may be an array or RAQB's id map. Field names and value types come from the tree; the inferred schema fills in the rest.

Use it in your app

follows your input and settings

The converter is qnot's codecs. Declare the fields once and the same two calls run on your server or in the browser, typed end to end.

Questions

Is my query sent anywhere?
No. The converter is qnot running in your browser: parsing, schema inference and conversion all happen on this page, and nothing you paste leaves your browser.
Do I need my RAQB config?
No. The converter infers a schema from the tree. In an app you'd declare the fields with defineFields, which also gives you typed queries, and use the same raqb format to read and write RAQB trees.
What about array (rule_group) conditions?
They convert to $elemMatch in MongoDB and some/all/none in JsonLogic. SQL can express them on Postgres with a jsonb column; other dialects report the rule instead of dropping it.