Install and load
Run these commands in a Haybarn SQL session. The extension is available from the community repository.
INSTALL quickjs FROM community;
LOAD quickjs FROM community;
Try it in a temporary SQL session with quickjs already loaded. Queries run in this tab; examples using files or services need their own setup.
Using upstream DuckDB? Follow the maintainerβs installation instructions.
Usage example
Quack JS with QuickJS
-- Quack JS with QuickJS
-- Scalar
D SELECT quickjs('2+2');
ββββββββββββββββββ
β quickjs('2+2') β
β varchar β
ββββββββββββββββββ€
β 4 β
ββββββββββββββββββ
-- Scalar Eval
D SELECT quickjs_eval('(a, b) => a + b', 5, 3);
βββββββββββββββββββββββββββββββββββββββββ
β quickjs_eval('(a, b) => a + b', 5, 3) β
β json β
βββββββββββββββββββββββββββββββββββββββββ€
β 8 β
βββββββββββββββββββββββββββββββββββββββββ
-- Table Eval
D SELECT * FROM quickjs('parsed_arg0.map(x => x * arg1)', '[1, 2, 3, 4, 5]', 3);
ββββββββββ
β result β
β json β
ββββββββββ€
β 3 β
β 6 β
β 9 β
β 12 β
β 15 β
ββββββββββ
Provided by quackscience. Not yet verified on Haybarn 2.0.0.
Sample data & setupDocumentation and resources
Project and build details
- Repository
- quackscience/duckdb-quickjs
- License
- MIT
- Maintainers
- lmangani, rustyconover
- Written in
- C++
- Build source
96e0ba687861- Build definition
- Community descriptor