Search Shortcut cmd + k | ctrl + k
quickjs

DuckDB QuickJS Runtime Extension

Maintainer(s): lmangani, rustyconover

Compatibility Matrix

This table covers all DuckDB releases that have not reached end-of-life, including LTS releases, and shows the 2 most recent patch releases of each. Older patch releases are not listed, but the extension may be available for them as well.

Platform 1.4.4 1.4.5 1.5.5 1.5.6 2.0.0
Linux AMD64
Linux ARM64
macOS AMD64
macOS ARM64
Windows AMD64
Windows ARM64
WebAssembly

Installing and Loading

INSTALL quickjs FROM community;
LOAD quickjs;

Example

-- 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     │
└────────┘

About quickjs

For more information regarding usage, see the documentation.

Added Functions

This extension does not add any functions.

Overloaded Functions

This extension does not add any function overloads.

Added Types

This extension does not add any types.

Added Settings

This extension does not add any settings.