Meerkat is TypeScript SDK solution that seamlessly converts Cube-like queries to DuckDB queries. Whether you're using a browser or NodeJS, Meerkat delivers a powerful layer of abstraction for executing advanced queries.
A major feature of Meerkat is its utilization of DuckDB's Abstract Syntax Tree (AST) and the json_serialize_sql native utility. This is directly employed for two critical operations: serializing and deserializing SQL to JSON. By using this, we can effectively utilize all the features of the DuckDB query language without the need to rely on another query builder like React-query builder.
The DuckDB JSON AST gives Meerkat an edge; its extensibility far outpaces traditional query builders, hence providing more powerful and flexible solutions to complex queries.
This repository is a monorepo managed using Nx. It contains the following projects:
meerkat-core
- The core library that contains the core functionality of Meerkat.meerkat-node
- The library uses meerkat-core
and provides a NodeJS interface for executing queries.meerkat-browser
- The library uses meerkat-core
and provides a browser interface for executing queries.asdf plugin add nodejs
asdf install
node -v
Should print v18.x.y as defined in .tool-versions
filenvm install 18
nvm alias default 18
nvm use default
node -v
Should print v18.x.y.npmrc
file - Refer to this doc for more info.npm ci
There is no application to run, for testing your functionality you need to run the tests.
Example of running all tests
npx nx run-many --targets tests --all
Following steps can be used to link a local version of meerkat to a project:-
npm i
npx nx run-many --target=build --all --parallel
cd ./dist/meerkat-core && npm link
cd ../meerkat-browser && npm link && npm link @devrev/meerkat-core
package.json
of the project repo into which meerkat is to be linkedrm -rf node_modules && npm i
npm link --save @devrev/meerkat-node @devrev/meerkat-browser
npm unlink @devrev/meerkat-core @devrev/meerkat-browser