@duckcodeailabs/dql-runtime 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# `@duckcodeailabs/dql-runtime`
|
|
2
|
+
|
|
3
|
+
Browser runtime for compiled DQL output.
|
|
4
|
+
|
|
5
|
+
It includes query fetching, chart rendering helpers, table/KPI renderers, filter and interaction management, and hot-reload helpers used by preview flows.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pnpm add @duckcodeailabs/dql-runtime
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import { DataFetcher } from '@duckcodeailabs/dql-runtime';
|
|
17
|
+
|
|
18
|
+
const fetcher = new DataFetcher('/api/query');
|
|
19
|
+
|
|
20
|
+
const result = await fetcher.fetch(
|
|
21
|
+
'revenue_by_segment',
|
|
22
|
+
'select 1 as revenue',
|
|
23
|
+
[],
|
|
24
|
+
{},
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
console.log(result.rows);
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Common Uses
|
|
31
|
+
|
|
32
|
+
- power browser previews for compiled DQL bundles
|
|
33
|
+
- connect compiled charts to a local or hosted query API
|
|
34
|
+
- add interactions and filters to runtime rendering flows
|
|
35
|
+
|
|
36
|
+
## Learn More
|
|
37
|
+
|
|
38
|
+
- Root docs: [`../../README.md`](../../README.md)
|
|
39
|
+
- Getting started: [`../../docs/getting-started.md`](../../docs/getting-started.md)
|