This release is 2 versions behind 0.2.1 — the latest version of @dringtech/lume-duck. Jump to latest
@dringtech/lume-duck@0.1.2Built and signed on GitHub ActionsBuilt and signed on GitHub Actions
Built and signed on GitHub Actions
Helpers for working with DuckDB data in the Lume SSG
This package works with DenoIt is unknown whether this package works with Cloudflare Workers, Node.js, Bun
JSR Score
94%
Published
7 months ago (0.1.2)
lume-duck
You will need to have the appropriate DuckDB library installed for your system! See https://duckdb.org/docs/installation/index?version=stable&environment=cplusplus
Quick start
Add the following lines to your Lume _config.ts file
import { duckDbLoader } from "jsr:@dringtech/lume-duck"; site.loadData([".sql"], duckDbLoader());
Any SQL files in _data
directories will be loaded as DuckDB queries. The data
file name is a function which executes the contained SQL, i.e.
_data/sample.sql
would be accessible as sample()
.
Examples (each assumes in a file called _data/query.sql
):
SQL | Query | Result |
---|---|---|
SELECT 1 AS number; |
query() |
[{number:1}] |
SELECT ?::INTEGER AS number; |
query(2) |
[{number:2}] |
SELECT ?::INTEGER AS number, ?::STRING AS string; |
query(3, 'x') |
[{number:3,string:'x'}] |
SELECT $2::INTEGER AS number, $1::STRING AS string; |
query('y', 4) |
[{number:4,string:'y'}] |
Built and signed on
View transparency logGitHub Actions
Add Package
deno add jsr:@dringtech/lume-duck
Import symbol
import * as lume_duck from "@dringtech/lume-duck";
---- OR ----
Import directly with a jsr specifier
import * as lume_duck from "jsr:@dringtech/lume-duck";
Add Package
npx jsr add @dringtech/lume-duck
Import symbol
import * as lume_duck from "@dringtech/lume-duck";
Add Package
yarn dlx jsr add @dringtech/lume-duck
Import symbol
import * as lume_duck from "@dringtech/lume-duck";
Add Package
pnpm dlx jsr add @dringtech/lume-duck
Import symbol
import * as lume_duck from "@dringtech/lume-duck";
Add Package
bunx jsr add @dringtech/lume-duck
Import symbol
import * as lume_duck from "@dringtech/lume-duck";