@ingestron/cli 1.2.0 → 1.3.0
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/dist/packs.d.ts.map +1 -1
- package/dist/packs.js +2 -1
- package/dist/packs.js.map +1 -1
- package/package.json +7 -5
- package/project-templates/duckdb/README.md +26 -0
- package/project-templates/duckdb/connections/shop.yaml +8 -0
- package/project-templates/duckdb/contracts/customer_totals.yaml +13 -0
- package/project-templates/duckdb/contracts/orders.yaml +14 -0
- package/project-templates/duckdb/flows/orders.yaml +6 -0
- package/project-templates/duckdb/platform.yaml +6 -0
- package/project-templates/duckdb/project.yaml +12 -0
- package/project-templates/duckdb/published/.gitkeep +0 -0
- package/project-templates/duckdb/samples/orders.csv +6 -0
- package/project-templates/duckdb/standard.yaml +7 -0
- package/project-templates/duckdb/template.yaml +3 -0
- package/project-templates/duckdb/transforms/customer_totals.yaml +10 -0
package/dist/packs.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packs.d.ts","sourceRoot":"","sources":["../src/packs.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"packs.d.ts","sourceRoot":"","sources":["../src/packs.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAMnD,iDAAiD;AACjD,eAAO,MAAM,KAAK,EAAE,IAAI,EAAuC,CAAC"}
|
package/dist/packs.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { adf } from "@ingestron/pack-adf";
|
|
2
2
|
import { databricks } from "@ingestron/pack-databricks";
|
|
3
|
+
import { duckdb } from "@ingestron/pack-duckdb";
|
|
3
4
|
import { synapse } from "@ingestron/pack-synapse";
|
|
4
5
|
/** The packs available to `ingestron`, by id. */
|
|
5
|
-
export const packs = [databricks, adf, synapse];
|
|
6
|
+
export const packs = [databricks, adf, synapse, duckdb];
|
|
6
7
|
//# sourceMappingURL=packs.js.map
|
package/dist/packs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packs.js","sourceRoot":"","sources":["../src/packs.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAElD,iDAAiD;AACjD,MAAM,CAAC,MAAM,KAAK,GAAW,CAAC,UAAU,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"packs.js","sourceRoot":"","sources":["../src/packs.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAElD,iDAAiD;AACjD,MAAM,CAAC,MAAM,KAAK,GAAW,CAAC,UAAU,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ingestron/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "ingestron plan | apply | check | schemas: generate platform assets from definitions.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "IntentLabs <hello@ingestron.io>",
|
|
@@ -36,13 +36,15 @@
|
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@ingestron/pack-adf": "^1.1.0",
|
|
38
38
|
"@ingestron/pack-databricks": "^1.0.0",
|
|
39
|
-
"
|
|
39
|
+
"@ingestron/pack-duckdb": "^1.0.0",
|
|
40
40
|
"@ingestron/pack-synapse": "^1.0.1",
|
|
41
|
-
"
|
|
42
|
-
"@ingestron/
|
|
43
|
-
"@ingestron/generate": "^1.0.0"
|
|
41
|
+
"yaml": "2.9.1",
|
|
42
|
+
"@ingestron/config": "^1.1.0",
|
|
43
|
+
"@ingestron/generate": "^1.0.0",
|
|
44
|
+
"@ingestron/definitions": "^1.3.1"
|
|
44
45
|
},
|
|
45
46
|
"devDependencies": {
|
|
47
|
+
"@duckdb/node-api": "1.5.6-r.2",
|
|
46
48
|
"@microsoft/api-extractor": "7.59.4",
|
|
47
49
|
"@types/node": "22.20.5",
|
|
48
50
|
"ajv": "8.20.0",
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# DuckDB on a laptop
|
|
2
|
+
|
|
3
|
+
Sample orders loaded into a local DuckDB database, a SQL transform over them,
|
|
4
|
+
and both tables published as Parquet: nothing to set up but the DuckDB command
|
|
5
|
+
line.
|
|
6
|
+
|
|
7
|
+
| File | What it shows |
|
|
8
|
+
| --------------------------------- | ------------------------------------------------------ |
|
|
9
|
+
| `standard.yaml` | `packs: [duckdb@1]`, and CSV files |
|
|
10
|
+
| `platform.yaml` | `published`: the folder each table is published to |
|
|
11
|
+
| `connections/shop.yaml` | A files source in the project folder, `./samples` |
|
|
12
|
+
| `flows/orders.yaml` | `samples/orders.csv` becomes the table `bronze.orders` |
|
|
13
|
+
| `transforms/customer_totals.yaml` | SQL over the orders, kept as `silver.customer_totals` |
|
|
14
|
+
| `contracts/*.yaml` | ODCS contracts: the columns and their types |
|
|
15
|
+
|
|
16
|
+
From the project folder:
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
ingestron apply
|
|
20
|
+
duckdb ingestron.duckdb < build/dev/run.sql
|
|
21
|
+
duckdb ingestron.duckdb "SELECT * FROM silver.customer_totals"
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Running again is safe. Each run publishes `published/bronze.orders.parquet`
|
|
25
|
+
and `published/silver.customer_totals.parquet`, which Power BI and other tools
|
|
26
|
+
read as files.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
apiVersion: v3.1.0
|
|
2
|
+
kind: DataContract
|
|
3
|
+
id: shop.customer_totals
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
status: active
|
|
6
|
+
schema:
|
|
7
|
+
- name: customer_totals
|
|
8
|
+
logicalType: object
|
|
9
|
+
description: Orders and their total per customer.
|
|
10
|
+
properties:
|
|
11
|
+
- { name: customer, logicalType: string, primaryKey: true }
|
|
12
|
+
- { name: orders, logicalType: integer }
|
|
13
|
+
- { name: total, logicalType: number }
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
apiVersion: v3.1.0
|
|
2
|
+
kind: DataContract
|
|
3
|
+
id: shop.orders
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
status: active
|
|
6
|
+
schema:
|
|
7
|
+
- name: orders
|
|
8
|
+
logicalType: object
|
|
9
|
+
description: One row per order.
|
|
10
|
+
properties:
|
|
11
|
+
- { name: order_id, logicalType: integer, required: true, primaryKey: true }
|
|
12
|
+
- { name: customer, logicalType: string }
|
|
13
|
+
- { name: amount, logicalType: number }
|
|
14
|
+
- { name: ordered_at, logicalType: date }
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Runs on a laptop: DuckDB reads samples/, keeps the tables in ingestron.duckdb
|
|
2
|
+
# and publishes each one to published/ as Parquet.
|
|
3
|
+
id: shop
|
|
4
|
+
environments:
|
|
5
|
+
dev: {}
|
|
6
|
+
imports:
|
|
7
|
+
- standard.yaml
|
|
8
|
+
- platform.yaml
|
|
9
|
+
- connections/*.yaml
|
|
10
|
+
- flows/*.yaml
|
|
11
|
+
- transforms/*.yaml
|
|
12
|
+
- contracts/*.yaml
|
|
File without changes
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
apiVersion: ingestron.io/v1
|
|
2
|
+
kind: Transform
|
|
3
|
+
id: customer_totals
|
|
4
|
+
description: Orders and their total per customer.
|
|
5
|
+
inputs: [orders]
|
|
6
|
+
code: |
|
|
7
|
+
SELECT customer, count(*) AS orders, sum(amount) AS total
|
|
8
|
+
FROM {{ tables.orders }}
|
|
9
|
+
GROUP BY customer
|
|
10
|
+
contract: shop.customer_totals
|