create-dql-app 1.6.0 → 1.6.1

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.
Files changed (66) hide show
  1. package/README.md +9 -13
  2. package/bin/create-dql-app.mjs +16 -8
  3. package/package.json +2 -2
  4. package/templates/starter/README.md +34 -0
  5. package/templates/starter/gitignore +17 -0
  6. package/templates/{jaffle-shop → starter}/package.json +7 -4
  7. package/templates/acme-bank/.dql/skills/mei.chen@acme-bank.com/cards-fraud.skill.md +0 -15
  8. package/templates/acme-bank/.dql/skills/sara.fitch@acme-bank.com/cfo-weekly.skill.md +0 -15
  9. package/templates/acme-bank/README.md +0 -75
  10. package/templates/acme-bank/apps/cards-ops/README.md +0 -9
  11. package/templates/acme-bank/apps/cards-ops/dashboards/daily-ops.dqld +0 -65
  12. package/templates/acme-bank/apps/cards-ops/dashboards/fraud-watch.dqld +0 -37
  13. package/templates/acme-bank/apps/cards-ops/dql.app.json +0 -89
  14. package/templates/acme-bank/apps/cards-ops/drafts/.gitkeep +0 -1
  15. package/templates/acme-bank/apps/cards-ops/notebooks/.gitkeep +0 -1
  16. package/templates/acme-bank/apps/executive-cockpit/README.md +0 -9
  17. package/templates/acme-bank/apps/executive-cockpit/dashboards/bank-overview.dqld +0 -57
  18. package/templates/acme-bank/apps/executive-cockpit/dql.app.json +0 -82
  19. package/templates/acme-bank/apps/executive-cockpit/drafts/.gitkeep +0 -1
  20. package/templates/acme-bank/apps/executive-cockpit/notebooks/.gitkeep +0 -1
  21. package/templates/acme-bank/apps/retail-deposits/README.md +0 -9
  22. package/templates/acme-bank/apps/retail-deposits/dashboards/deposit-growth.dqld +0 -48
  23. package/templates/acme-bank/apps/retail-deposits/dql.app.json +0 -59
  24. package/templates/acme-bank/apps/retail-deposits/drafts/.gitkeep +0 -1
  25. package/templates/acme-bank/apps/retail-deposits/notebooks/.gitkeep +0 -1
  26. package/templates/acme-bank/apps/risk-office/README.md +0 -8
  27. package/templates/acme-bank/apps/risk-office/dashboards/credit-risk.dqld +0 -48
  28. package/templates/acme-bank/apps/risk-office/dql.app.json +0 -57
  29. package/templates/acme-bank/apps/risk-office/drafts/.gitkeep +0 -1
  30. package/templates/acme-bank/apps/risk-office/notebooks/.gitkeep +0 -1
  31. package/templates/acme-bank/blocks/cards/card_approval_rate.dql +0 -24
  32. package/templates/acme-bank/blocks/cards/daily_transaction_volume.dql +0 -34
  33. package/templates/acme-bank/blocks/cards/fraud_alerts_by_region.dql +0 -33
  34. package/templates/acme-bank/blocks/cards/fraud_by_merchant_recent.dql +0 -33
  35. package/templates/acme-bank/blocks/deposits/branch_deposit_leaders.dql +0 -30
  36. package/templates/acme-bank/blocks/deposits/deposit_trend.dql +0 -30
  37. package/templates/acme-bank/blocks/deposits/deposits_by_segment.dql +0 -33
  38. package/templates/acme-bank/blocks/executive/bank_health_scorecard.dql +0 -34
  39. package/templates/acme-bank/blocks/lending/high_risk_loan_exposure.dql +0 -31
  40. package/templates/acme-bank/blocks/lending/loan_delinquency_by_region.dql +0 -32
  41. package/templates/acme-bank/data/customers.csv +0 -12
  42. package/templates/acme-bank/data/deposits.csv +0 -22
  43. package/templates/acme-bank/data/fraud_alerts.csv +0 -9
  44. package/templates/acme-bank/data/loans.csv +0 -11
  45. package/templates/acme-bank/data/merchants.csv +0 -10
  46. package/templates/acme-bank/data/transactions.csv +0 -20
  47. package/templates/acme-bank/dql.config.json +0 -21
  48. package/templates/acme-bank/notebooks/cards_fraud_ops.dqlnb +0 -47
  49. package/templates/acme-bank/notebooks/credit_risk_review.dqlnb +0 -42
  50. package/templates/acme-bank/notebooks/executive_weekly_review.dqlnb +0 -47
  51. package/templates/acme-bank/notebooks/retail_deposits_review.dqlnb +0 -42
  52. package/templates/acme-bank/notebooks/welcome.dqlnb +0 -44
  53. package/templates/acme-bank/package.json +0 -18
  54. package/templates/acme-bank/semantic-layer/dimensions/banking.yaml +0 -36
  55. package/templates/acme-bank/semantic-layer/metrics/banking.yaml +0 -37
  56. package/templates/empty/README.md +0 -19
  57. package/templates/empty/dql.config.json +0 -13
  58. package/templates/empty/package.json +0 -13
  59. package/templates/jaffle-shop/README.md +0 -48
  60. package/templates/jaffle-shop/blocks/revenue_by_segment.dql +0 -26
  61. package/templates/jaffle-shop/dashboards/overview.dql +0 -27
  62. package/templates/jaffle-shop/notebooks/welcome.dqlnb +0 -33
  63. package/templates/jaffle-shop/semantic-layer/dimensions/customer.yaml +0 -14
  64. package/templates/jaffle-shop/semantic-layer/metrics/revenue.yaml +0 -9
  65. /package/templates/{jaffle-shop → starter}/dql.config.json +0 -0
  66. /package/templates/{empty → starter}/notebooks/welcome.dqlnb +0 -0
@@ -1,20 +0,0 @@
1
- txn_id,customer_id,merchant_id,amount_usd,status,region,branch_id,txn_ts
2
- T001,C001,M-amzn,84.20,approved,NA-NE,NYC-042,2026-04-20T08:14:00Z
3
- T002,C002,M-walmart,162.00,approved,NA-W,SFO-007,2026-04-20T08:32:00Z
4
- T003,C001,M-amzn,4900.00,approved,NA-NE,NYC-042,2026-04-20T22:11:00Z
5
- T004,C004,M-darknet1,2700.00,declined,EMEA,LON-018,2026-04-20T22:14:00Z
6
- T005,C008,M-darknet1,3200.00,declined,EMEA,LON-018,2026-04-20T22:18:00Z
7
- T006,C005,M-target,242.50,approved,NA-SE,ATL-011,2026-04-21T09:04:00Z
8
- T007,C006,M-apple,1180.00,approved,NA-W,SEA-004,2026-04-21T10:41:00Z
9
- T008,C010,M-home,1580.25,approved,NA-W,SFO-007,2026-04-21T15:30:00Z
10
- T009,C003,M-amzn,440.00,approved,NA-NE,BOS-015,2026-04-22T11:01:00Z
11
- T010,C004,M-travel,5200.00,approved,EMEA,LON-018,2026-04-22T14:18:00Z
12
- T011,C007,M-grocery,76.11,approved,NA-SE,ATL-011,2026-04-23T07:40:00Z
13
- T012,C008,M-darknet1,4100.00,declined,EMEA,LON-018,2026-04-23T23:09:00Z
14
- T013,C001,M-travel,2200.00,approved,NA-NE,NYC-042,2026-04-24T18:21:00Z
15
- T014,C002,M-amzn,93.42,approved,NA-W,SFO-007,2026-04-24T19:44:00Z
16
- T015,C009,M-apple,890.00,approved,NA-NE,NYC-042,2026-04-25T13:17:00Z
17
- T016,C005,M-darknet1,1800.00,declined,NA-SE,ATL-011,2026-04-25T23:22:00Z
18
- T017,C006,M-walmart,338.20,approved,NA-W,SEA-004,2026-04-26T09:30:00Z
19
- T018,C003,M-home,2800.00,approved,NA-NE,BOS-015,2026-04-26T12:08:00Z
20
-
@@ -1,21 +0,0 @@
1
- {
2
- "project": "{{PROJECT_NAME}}",
3
- "connections": {
4
- "default": {
5
- "driver": "duckdb",
6
- "filepath": ":memory:"
7
- }
8
- },
9
- "semanticLayer": {
10
- "provider": "dql",
11
- "path": "semantic-layer"
12
- },
13
- "dbt": {
14
- "projectDir": "{{DBT_PROJECT_DIR}}",
15
- "manifestPath": "target/manifest.json"
16
- },
17
- "governance": {
18
- "required_fields": ["domain", "owner", "description"]
19
- }
20
- }
21
-
@@ -1,47 +0,0 @@
1
- {
2
- "dqlnbVersion": 1,
3
- "version": 1,
4
- "metadata": {
5
- "title": "Cards Fraud Operations",
6
- "description": "Daily card volume, approval rate, and fraud exposure review for Cards Operations.",
7
- "status": "certified",
8
- "categories": ["cards", "fraud", "operations"],
9
- "owner": "mei.chen@acme-bank.com"
10
- },
11
- "cells": [
12
- {
13
- "id": "intro",
14
- "type": "markdown",
15
- "source": "# Cards Fraud Operations\n\nUse this notebook when fraud analysts need to inspect the same certified logic that powers the Cards Operations App.\n\nRun the SQL cells for raw context, then run the certified block cells to compare with the packaged App dashboard."
16
- },
17
- {
18
- "id": "daily_status_volume",
19
- "title": "Daily card volume by status",
20
- "type": "sql",
21
- "source": "SELECT\n CAST(txn_ts AS DATE) AS day,\n status,\n COUNT(*) AS txn_count,\n ROUND(SUM(amount_usd), 2) AS volume_usd\nFROM read_csv_auto('./data/transactions.csv')\nGROUP BY 1, 2\nORDER BY 1, 2"
22
- },
23
- {
24
- "id": "approval_rate",
25
- "title": "Approval rate (certified block)",
26
- "type": "dql",
27
- "source": "@block(\"card_approval_rate\")"
28
- },
29
- {
30
- "id": "fraud_region",
31
- "title": "Fraud exposure by region and branch (certified block)",
32
- "type": "dql",
33
- "source": "@block(\"fraud_alerts_by_region\")"
34
- },
35
- {
36
- "id": "merchant_watchlist",
37
- "title": "Merchant watchlist",
38
- "type": "sql",
39
- "source": "SELECT\n m.merchant_name,\n m.merchant_category,\n m.risk_band,\n COUNT(*) AS alerts,\n ROUND(SUM(f.amount_usd), 2) AS exposure_usd\nFROM read_csv_auto('./data/fraud_alerts.csv') f\nJOIN read_csv_auto('./data/merchants.csv') m ON f.merchant_id = m.merchant_id\nGROUP BY 1, 2, 3\nORDER BY exposure_usd DESC"
40
- },
41
- {
42
- "id": "next_step",
43
- "type": "markdown",
44
- "source": "## App handoff\n\nOpen Apps -> Cards Operations -> Fraud Watch to see these same certified blocks packaged for stakeholders with persona preview."
45
- }
46
- ]
47
- }
@@ -1,42 +0,0 @@
1
- {
2
- "dqlnbVersion": 1,
3
- "version": 1,
4
- "metadata": {
5
- "title": "Credit Risk Review",
6
- "description": "Regional delinquency, probability of default, and high-risk exposure for risk office review.",
7
- "status": "certified",
8
- "categories": ["lending", "risk", "delinquency"],
9
- "owner": "anika.shah@acme-bank.com"
10
- },
11
- "cells": [
12
- {
13
- "id": "intro",
14
- "type": "markdown",
15
- "source": "# Credit Risk Review\n\nRisk analysts can use this notebook to inspect lending exposure before sending a dashboard to the Risk Office App."
16
- },
17
- {
18
- "id": "risk_grade_exposure",
19
- "title": "Exposure by risk grade",
20
- "type": "sql",
21
- "source": "SELECT\n risk_grade,\n COUNT(*) AS loan_count,\n ROUND(SUM(outstanding_usd), 2) AS outstanding_usd,\n ROUND(AVG(probability_default), 4) AS avg_probability_default\nFROM read_csv_auto('./data/loans.csv')\nGROUP BY 1\nORDER BY risk_grade"
22
- },
23
- {
24
- "id": "delinquency_region",
25
- "title": "Delinquency by region (certified block)",
26
- "type": "dql",
27
- "source": "@block(\"loan_delinquency_by_region\")"
28
- },
29
- {
30
- "id": "high_risk_exposure",
31
- "title": "High risk exposure (certified block)",
32
- "type": "dql",
33
- "source": "@block(\"high_risk_loan_exposure\")"
34
- },
35
- {
36
- "id": "past_due_detail",
37
- "title": "Loans past due by product",
38
- "type": "sql",
39
- "source": "SELECT\n product,\n COUNT(*) AS loans,\n ROUND(SUM(outstanding_usd), 2) AS outstanding_usd,\n ROUND(SUM(CASE WHEN days_past_due >= 30 THEN outstanding_usd ELSE 0 END), 2) AS delinquent_balance_usd\nFROM read_csv_auto('./data/loans.csv')\nGROUP BY 1\nORDER BY delinquent_balance_usd DESC"
40
- }
41
- ]
42
- }
@@ -1,47 +0,0 @@
1
- {
2
- "dqlnbVersion": 1,
3
- "version": 1,
4
- "metadata": {
5
- "title": "Executive Weekly Review",
6
- "description": "Cross-domain CXO notebook combining cards, deposits, lending, and the executive scorecard.",
7
- "status": "certified",
8
- "categories": ["executive", "weekly-review", "cxo"],
9
- "owner": "sara.fitch@acme-bank.com"
10
- },
11
- "cells": [
12
- {
13
- "id": "intro",
14
- "type": "markdown",
15
- "source": "# Executive Weekly Review\n\nThis notebook is the analyst working surface behind the Executive Cockpit App. It combines certified blocks across cards, deposits, and lending."
16
- },
17
- {
18
- "id": "scorecard",
19
- "title": "Bank health scorecard (certified block)",
20
- "type": "dql",
21
- "source": "@block(\"bank_health_scorecard\")"
22
- },
23
- {
24
- "id": "deposit_trend",
25
- "title": "Deposit trend",
26
- "type": "dql",
27
- "source": "@block(\"deposit_trend\")"
28
- },
29
- {
30
- "id": "fraud_exposure",
31
- "title": "Fraud exposure",
32
- "type": "dql",
33
- "source": "@block(\"fraud_alerts_by_region\")"
34
- },
35
- {
36
- "id": "credit_risk",
37
- "title": "Credit risk",
38
- "type": "dql",
39
- "source": "@block(\"loan_delinquency_by_region\")"
40
- },
41
- {
42
- "id": "action_notes",
43
- "type": "markdown",
44
- "source": "## Action notes\n\n- Fraud analysts review branch-level alerts in the Cards Operations App.\n- Retail leaders monitor net-new deposits in the Retail Deposits App.\n- Risk office reviews high-risk exposure in the Risk Office App.\n- Executives consume the packaged summary in the Executive Cockpit App."
45
- }
46
- ]
47
- }
@@ -1,42 +0,0 @@
1
- {
2
- "dqlnbVersion": 1,
3
- "version": 1,
4
- "metadata": {
5
- "title": "Retail Deposits Review",
6
- "description": "Deposit balance trend, segment mix, and branch leaders for retail banking.",
7
- "status": "certified",
8
- "categories": ["deposits", "retail", "growth"],
9
- "owner": "diego.ramos@acme-bank.com"
10
- },
11
- "cells": [
12
- {
13
- "id": "intro",
14
- "type": "markdown",
15
- "source": "# Retail Deposits Review\n\nRetail leaders use this notebook to inspect deposit growth before packaging the same metrics into the Retail Deposits App."
16
- },
17
- {
18
- "id": "deposit_snapshot",
19
- "title": "Deposit snapshot by region",
20
- "type": "sql",
21
- "source": "SELECT\n as_of_date,\n region,\n ROUND(SUM(balance_usd), 2) AS balance_usd,\n ROUND(SUM(net_new_usd), 2) AS net_new_usd\nFROM read_csv_auto('./data/deposits.csv')\nGROUP BY 1, 2\nORDER BY 1, 2"
22
- },
23
- {
24
- "id": "deposit_trend",
25
- "title": "Deposit trend (certified block)",
26
- "type": "dql",
27
- "source": "@block(\"deposit_trend\")"
28
- },
29
- {
30
- "id": "segment_balance",
31
- "title": "Deposits by segment (certified block)",
32
- "type": "dql",
33
- "source": "@block(\"deposits_by_segment\")"
34
- },
35
- {
36
- "id": "branch_leaders",
37
- "title": "Branch deposit leaders (certified block)",
38
- "type": "dql",
39
- "source": "@block(\"branch_deposit_leaders\")"
40
- }
41
- ]
42
- }
@@ -1,44 +0,0 @@
1
- {
2
- "dqlnbVersion": 1,
3
- "version": 1,
4
- "metadata": {
5
- "title": "{{PROJECT_NAME}} - Acme Bank Walkthrough",
6
- "description": "Run certified banking blocks, then open Apps for stakeholder dashboards."
7
- },
8
- "cells": [
9
- {
10
- "id": "intro",
11
- "type": "markdown",
12
- "source": "# Acme Bank\n\nThis notebook uses the packaged Acme Bank CSV warehouse and certified DQL blocks.\n\nRun the cells top-to-bottom, then click Apps in the left rail to open Cards Operations, Retail Deposits, Risk Office, and Executive Cockpit.\n\nAdditional sample notebooks are included for cards fraud operations, retail deposits, credit risk, and executive review."
13
- },
14
- {
15
- "title": "Raw transaction health",
16
- "id": "raw_transaction_health",
17
- "type": "sql",
18
- "source": "SELECT status, COUNT(*) AS transactions, ROUND(SUM(amount_usd), 2) AS volume_usd\nFROM read_csv_auto('./data/transactions.csv')\nGROUP BY 1\nORDER BY volume_usd DESC"
19
- },
20
- {
21
- "title": "Fraud alerts by region (certified block)",
22
- "id": "fraud_alerts_by_region",
23
- "type": "dql",
24
- "source": "@block(\"fraud_alerts_by_region\")"
25
- },
26
- {
27
- "title": "Deposit trend (certified block)",
28
- "id": "deposit_trend",
29
- "type": "dql",
30
- "source": "@block(\"deposit_trend\")"
31
- },
32
- {
33
- "title": "Executive scorecard (certified block)",
34
- "id": "bank_health_scorecard",
35
- "type": "dql",
36
- "source": "@block(\"bank_health_scorecard\")"
37
- },
38
- {
39
- "id": "next_notebooks",
40
- "type": "markdown",
41
- "source": "## Next sample notebooks\n\n- `notebooks/cards_fraud_ops.dqlnb` - branch-aware fraud monitoring\n- `notebooks/retail_deposits_review.dqlnb` - deposit growth and segment mix\n- `notebooks/credit_risk_review.dqlnb` - delinquency and high-risk exposure\n- `notebooks/executive_weekly_review.dqlnb` - CXO scorecard and cross-domain review"
42
- }
43
- ]
44
- }
@@ -1,18 +0,0 @@
1
- {
2
- "name": "{{PROJECT_NAME}}",
3
- "version": "0.1.0",
4
- "private": true,
5
- "description": "Acme Bank DQL analytics project.",
6
- "scripts": {
7
- "notebook": "dql notebook",
8
- "compile": "dql compile",
9
- "app:build": "dql app build",
10
- "agent:reindex": "dql agent reindex",
11
- "verify": "dql verify .",
12
- "doctor": "dql doctor",
13
- "test": "dql test"
14
- },
15
- "devDependencies": {
16
- "@duckcodeailabs/dql-cli": "^1.5.3"
17
- }
18
- }
@@ -1,36 +0,0 @@
1
- dimensions:
2
- - name: region
3
- label: Region
4
- type: string
5
- sql: region
6
- table: customers
7
- domain: banking
8
-
9
- - name: branch_id
10
- label: Branch
11
- type: string
12
- sql: branch_id
13
- table: customers
14
- domain: banking
15
-
16
- - name: customer_segment
17
- label: Customer Segment
18
- type: string
19
- sql: segment
20
- table: customers
21
- domain: deposits
22
-
23
- - name: merchant_category
24
- label: Merchant Category
25
- type: string
26
- sql: merchant_category
27
- table: merchants
28
- domain: cards
29
-
30
- - name: risk_grade
31
- label: Loan Risk Grade
32
- type: string
33
- sql: risk_grade
34
- table: loans
35
- domain: lending
36
-
@@ -1,37 +0,0 @@
1
- metrics:
2
- - name: card_volume
3
- label: Card Volume
4
- description: Total card transaction volume in USD.
5
- type: sum
6
- sql: amount_usd
7
- table: transactions
8
- domain: cards
9
- tags: [cards, volume]
10
-
11
- - name: fraud_exposure
12
- label: Fraud Exposure
13
- description: Total fraud alert exposure in USD.
14
- type: sum
15
- sql: amount_usd
16
- table: fraud_alerts
17
- domain: cards
18
- tags: [fraud, risk]
19
-
20
- - name: deposit_balance
21
- label: Deposit Balance
22
- description: Total customer deposit balance.
23
- type: sum
24
- sql: balance_usd
25
- table: deposits
26
- domain: deposits
27
- tags: [deposits, balance]
28
-
29
- - name: loan_outstanding
30
- label: Loan Outstanding
31
- description: Total outstanding loan balance.
32
- type: sum
33
- sql: outstanding_usd
34
- table: loans
35
- domain: lending
36
- tags: [lending, exposure]
37
-
@@ -1,19 +0,0 @@
1
- # {{PROJECT_NAME}}
2
-
3
- An empty DQL project, scaffolded by `create-dql-app --template empty`.
4
-
5
- ## Connect your warehouse
6
-
7
- Edit `dql.config.json` — DQL ships 15 drivers out of the box:
8
- [docs/reference/connectors.md](https://github.com/duckcode-ai/dql/blob/main/docs/reference/connectors.md).
9
-
10
- ```bash
11
- npm install
12
- npm run doctor
13
- ```
14
-
15
- ## Start the notebook
16
-
17
- ```bash
18
- npm run notebook
19
- ```
@@ -1,13 +0,0 @@
1
- {
2
- "project": "{{PROJECT_NAME}}",
3
- "connections": {
4
- "default": {
5
- "driver": "duckdb",
6
- "filepath": ":memory:"
7
- }
8
- },
9
- "semanticLayer": {
10
- "provider": "dql",
11
- "path": "semantic-layer"
12
- }
13
- }
@@ -1,13 +0,0 @@
1
- {
2
- "name": "{{PROJECT_NAME}}",
3
- "version": "0.1.0",
4
- "private": true,
5
- "scripts": {
6
- "notebook": "dql notebook",
7
- "compile": "dql compile",
8
- "doctor": "dql doctor"
9
- },
10
- "devDependencies": {
11
- "@duckcodeailabs/dql-cli": "^1.5.3"
12
- }
13
- }
@@ -1,48 +0,0 @@
1
- # {{PROJECT_NAME}}
2
-
3
- A DQL analytics project, scaffolded by `create-dql-app`.
4
-
5
- ## Run
6
-
7
- ```bash
8
- npm install
9
- npm run notebook
10
- ```
11
-
12
- Opens the notebook at <http://127.0.0.1:3474>. (`pnpm install && pnpm notebook`
13
- works too.)
14
-
15
- ## Layout
16
-
17
- ```
18
- dql.config.json project config (connections, dbt, semantic layer)
19
- package.json npm scripts — `notebook`, `compile`, `sync`, `doctor`
20
- notebooks/ .dqlnb notebooks (JSON format)
21
- blocks/ certified reusable .dql blocks
22
- semantic-layer/ metrics + dimensions authored locally
23
- dashboards/ compiled static HTML dashboards (git-ignored)
24
- ```
25
-
26
- ## Using with dbt
27
-
28
- If your dbt project is a sibling (e.g. `../dbt`), it was auto-wired into
29
- `dql.config.json` under the `dbt:` key. Then:
30
-
31
- ```bash
32
- (cd ../dbt && dbt parse) # produces target/manifest.json
33
- npm run sync # refreshes the DQL cache from dbt
34
- npm run compile # builds dql-manifest.json with lineage
35
- ```
36
-
37
- ## Next steps
38
-
39
- 1. **Run the welcome notebook** — `notebooks/welcome.dqlnb`
40
- 2. **Connect your warehouse** — [docs/guides/connect-warehouse.md](https://github.com/duckcode-ai/dql/blob/main/docs/guides/connect-warehouse.md)
41
- 3. **Import your dbt project** — [docs/guides/import-dbt.md](https://github.com/duckcode-ai/dql/blob/main/docs/guides/import-dbt.md)
42
- 4. **Author a certified block** — [docs/guides/authoring-blocks.md](https://github.com/duckcode-ai/dql/blob/main/docs/guides/authoring-blocks.md)
43
-
44
- ## Learn
45
-
46
- - [Quickstart](https://github.com/duckcode-ai/dql/blob/main/docs/01-quickstart.md)
47
- - [Concepts](https://github.com/duckcode-ai/dql/blob/main/docs/02-concepts.md)
48
- - [CLI reference](https://github.com/duckcode-ai/dql/blob/main/docs/reference/cli.md)
@@ -1,26 +0,0 @@
1
- // dql-format: 1
2
-
3
- block "Revenue by segment" {
4
- domain = "finance"
5
- type = "custom"
6
- description = "Gross revenue grouped by customer segment."
7
- tags = ["revenue", "sample"]
8
- query = """
9
- SELECT
10
- c.customer_segment AS segment,
11
- SUM(o.amount) AS revenue,
12
- COUNT(DISTINCT o.customer_id) AS customers
13
- FROM orders o
14
- JOIN customers c ON c.customer_id = o.customer_id
15
- GROUP BY 1
16
- ORDER BY revenue DESC
17
- """
18
- visualization {
19
- chart = "bar"
20
- x = segment
21
- y = revenue
22
- }
23
- tests {
24
- assert row_count > 0
25
- }
26
- }
@@ -1,27 +0,0 @@
1
- // dql-format: 1
2
-
3
- dashboard "{{PROJECT_NAME}} — Overview" {
4
- chart.kpi(
5
- SELECT SUM(amount) as revenue FROM orders,
6
- metrics = ["revenue"]
7
- )
8
- chart.bar(
9
- SELECT customer_id, SUM(amount) as spend
10
- FROM orders
11
- GROUP BY customer_id
12
- ORDER BY spend DESC
13
- LIMIT 10,
14
- x = customer_id,
15
- y = spend,
16
- title = "Top 10 customers by spend"
17
- )
18
- chart.line(
19
- SELECT order_date, SUM(amount) as revenue
20
- FROM orders
21
- GROUP BY order_date
22
- ORDER BY order_date,
23
- x = order_date,
24
- y = revenue,
25
- title = "Daily revenue"
26
- )
27
- }
@@ -1,33 +0,0 @@
1
- {
2
- "dqlnbVersion": 1,
3
- "version": 1,
4
- "metadata": {
5
- "title": "{{PROJECT_NAME}} — Welcome",
6
- "description": "A tour of DQL in four cells. Run them top-to-bottom with Cmd+Enter."
7
- },
8
- "cells": [
9
- {
10
- "id": "intro",
11
- "type": "markdown",
12
- "source": "# Welcome to {{PROJECT_NAME}}\n\nThis notebook runs against a DuckDB-backed Jaffle Shop dataset — the same demo data dbt ships.\n\n- Run each cell with `Cmd/Ctrl + Enter`.\n- Charts render inline from SQL results.\n- The certified block in cell 4 lives in `blocks/revenue_by_segment.dql` and can be reused across notebooks and dashboards."
13
- },
14
- {
15
- "title": "Orders overview",
16
- "id": "orders_overview",
17
- "type": "sql",
18
- "source": "select\n count(*) as total_orders,\n count(distinct customer_id) as unique_customers,\n sum(amount) as lifetime_revenue\nfrom orders"
19
- },
20
- {
21
- "title": "Daily revenue",
22
- "id": "daily_revenue",
23
- "type": "sql",
24
- "source": "select\n order_date,\n sum(amount) as revenue\nfrom orders\ngroup by 1\norder by 1"
25
- },
26
- {
27
- "title": "Revenue by segment (certified block)",
28
- "id": "revenue_by_segment",
29
- "type": "dql",
30
- "source": "@block(\"Revenue by segment\")"
31
- }
32
- ]
33
- }
@@ -1,14 +0,0 @@
1
- dimensions:
2
- - name: segment
3
- label: Customer segment
4
- type: string
5
- sql: segment
6
- table: customers
7
- domain: finance
8
-
9
- - name: region
10
- label: Region
11
- type: string
12
- sql: region
13
- table: customers
14
- domain: finance
@@ -1,9 +0,0 @@
1
- metrics:
2
- - name: revenue
3
- label: Revenue
4
- description: Gross revenue across all orders
5
- type: sum
6
- sql: order_total
7
- table: orders
8
- domain: finance
9
- tags: [revenue, core]