@duckcodeailabs/dql-governance 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 +47 -0
- package/package.json +3 -3
package/README.md
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# `@duckcodeailabs/dql-governance`
|
|
2
|
+
|
|
3
|
+
Governance helpers for testing, certification, policy checks, and cost estimation.
|
|
4
|
+
|
|
5
|
+
This package is useful when you want to turn DQL blocks into durable, reviewable analytics assets instead of one-off queries.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pnpm add @duckcodeailabs/dql-governance
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import { TestRunner } from '@duckcodeailabs/dql-governance';
|
|
17
|
+
|
|
18
|
+
const runner = new TestRunner({
|
|
19
|
+
async execute(sql) {
|
|
20
|
+
return [{ value: sql.includes('42') ? 42 : 0 }];
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
const result = await runner.runTests(
|
|
25
|
+
[
|
|
26
|
+
{
|
|
27
|
+
name: 'revenue is positive',
|
|
28
|
+
sql: 'select 42 as value',
|
|
29
|
+
operator: '>',
|
|
30
|
+
threshold: 0,
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
console.log(result.passed, result.failed);
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Common Uses
|
|
39
|
+
|
|
40
|
+
- run DQL `tests {}` assertions in CI
|
|
41
|
+
- apply certification rules before promotion
|
|
42
|
+
- estimate cost and enforce policy checks
|
|
43
|
+
|
|
44
|
+
## Learn More
|
|
45
|
+
|
|
46
|
+
- Root docs: [`../../README.md`](../../README.md)
|
|
47
|
+
- CLI reference: [`../../docs/cli-reference.md`](../../docs/cli-reference.md)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@duckcodeailabs/dql-governance",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "DQL Governance: block testing, certification, cost estimation, and access policies",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"access": "public"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@duckcodeailabs/dql-core": "0.1.
|
|
28
|
-
"@duckcodeailabs/dql-project": "0.1.
|
|
27
|
+
"@duckcodeailabs/dql-core": "0.1.2",
|
|
28
|
+
"@duckcodeailabs/dql-project": "0.1.2"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"typescript": "^5.7.0",
|