@duckcodeailabs/dql-cli 0.7.1 → 0.8.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 (110) hide show
  1. package/dist/args.js +1 -1
  2. package/dist/args.js.map +1 -1
  3. package/dist/args.test.js +3 -3
  4. package/dist/args.test.js.map +1 -1
  5. package/dist/assets/dql-notebook/assets/index-BZV40eAE.css +1 -0
  6. package/dist/assets/dql-notebook/assets/index-BsWoK_RX.js +532 -0
  7. package/dist/assets/dql-notebook/index.html +2 -1
  8. package/dist/commands/init.d.ts.map +1 -1
  9. package/dist/commands/init.js +107 -90
  10. package/dist/commands/init.js.map +1 -1
  11. package/dist/commands/init.test.js +8 -10
  12. package/dist/commands/init.test.js.map +1 -1
  13. package/dist/commands/new.test.js +8 -8
  14. package/dist/commands/new.test.js.map +1 -1
  15. package/dist/index.js +1 -2
  16. package/dist/index.js.map +1 -1
  17. package/dist/package.json +7 -7
  18. package/package.json +15 -14
  19. package/LICENSE +0 -123
  20. package/dist/assets/dql-notebook/assets/index-BwgX4Mvs.js +0 -510
  21. package/dist/assets/templates/dashboard/README.md +0 -30
  22. package/dist/assets/templates/dashboard/blocks/.gitkeep +0 -1
  23. package/dist/assets/templates/dashboard/dashboards/pipeline_overview.dql +0 -23
  24. package/dist/assets/templates/dashboard/data/pipeline.csv +0 -7
  25. package/dist/assets/templates/dashboard/dql.config.json +0 -18
  26. package/dist/assets/templates/dashboard/semantic-layer/.gitkeep +0 -1
  27. package/dist/assets/templates/dql.config.reference.json +0 -154
  28. package/dist/assets/templates/duckdb-local/README.md +0 -30
  29. package/dist/assets/templates/duckdb-local/blocks/orders_by_region.dql +0 -24
  30. package/dist/assets/templates/duckdb-local/data/orders.csv +0 -7
  31. package/dist/assets/templates/duckdb-local/dql.config.json +0 -18
  32. package/dist/assets/templates/duckdb-local/semantic-layer/.gitkeep +0 -1
  33. package/dist/assets/templates/ecommerce/README.md +0 -33
  34. package/dist/assets/templates/ecommerce/blocks/repeat_rate.dql +0 -26
  35. package/dist/assets/templates/ecommerce/blocks/revenue_by_segment.dql +0 -24
  36. package/dist/assets/templates/ecommerce/dashboards/revenue_command_center.dql +0 -25
  37. package/dist/assets/templates/ecommerce/data/customers.csv +0 -11
  38. package/dist/assets/templates/ecommerce/data/funnel.csv +0 -6
  39. package/dist/assets/templates/ecommerce/data/orders.csv +0 -16
  40. package/dist/assets/templates/ecommerce/dql.config.json +0 -18
  41. package/dist/assets/templates/ecommerce/semantic-layer/cubes/customers_cube.yaml +0 -49
  42. package/dist/assets/templates/ecommerce/semantic-layer/cubes/orders_cube.yaml +0 -70
  43. package/dist/assets/templates/ecommerce/semantic-layer/dimensions/channel.yaml +0 -8
  44. package/dist/assets/templates/ecommerce/semantic-layer/dimensions/order_date.yaml +0 -9
  45. package/dist/assets/templates/ecommerce/semantic-layer/dimensions/region.yaml +0 -9
  46. package/dist/assets/templates/ecommerce/semantic-layer/dimensions/segment.yaml +0 -8
  47. package/dist/assets/templates/ecommerce/semantic-layer/hierarchies/customer_geo.yaml +0 -18
  48. package/dist/assets/templates/ecommerce/semantic-layer/metrics/avg_order_value.yaml +0 -10
  49. package/dist/assets/templates/ecommerce/semantic-layer/metrics/gmv.yaml +0 -10
  50. package/dist/assets/templates/ecommerce/semantic-layer/metrics/gross_margin.yaml +0 -10
  51. package/dist/assets/templates/ecommerce/semantic-layer/metrics/order_count.yaml +0 -10
  52. package/dist/assets/templates/ecommerce/workbooks/.gitkeep +0 -1
  53. package/dist/assets/templates/finance-kpi/README.md +0 -31
  54. package/dist/assets/templates/finance-kpi/blocks/arr_kpi.dql +0 -21
  55. package/dist/assets/templates/finance-kpi/data/revenue.csv +0 -7
  56. package/dist/assets/templates/finance-kpi/dql.config.json +0 -18
  57. package/dist/assets/templates/finance-kpi/semantic-layer/.gitkeep +0 -1
  58. package/dist/assets/templates/saas/README.md +0 -32
  59. package/dist/assets/templates/saas/blocks/churn_pressure.dql +0 -25
  60. package/dist/assets/templates/saas/blocks/revenue_by_segment.dql +0 -25
  61. package/dist/assets/templates/saas/dashboards/growth_scorecard.dql +0 -25
  62. package/dist/assets/templates/saas/data/cohorts.csv +0 -7
  63. package/dist/assets/templates/saas/data/subscriptions.csv +0 -13
  64. package/dist/assets/templates/saas/dql.config.json +0 -18
  65. package/dist/assets/templates/saas/semantic-layer/dimensions/owner_segment.yaml +0 -8
  66. package/dist/assets/templates/saas/semantic-layer/dimensions/plan_tier.yaml +0 -8
  67. package/dist/assets/templates/saas/semantic-layer/dimensions/risk_bucket.yaml +0 -9
  68. package/dist/assets/templates/saas/semantic-layer/dimensions/status.yaml +0 -8
  69. package/dist/assets/templates/saas/semantic-layer/hierarchies/account_segments.yaml +0 -18
  70. package/dist/assets/templates/saas/semantic-layer/metrics/account_count.yaml +0 -10
  71. package/dist/assets/templates/saas/semantic-layer/metrics/expansion_mrr.yaml +0 -11
  72. package/dist/assets/templates/saas/semantic-layer/metrics/mrr.yaml +0 -10
  73. package/dist/assets/templates/saas/workbooks/.gitkeep +0 -1
  74. package/dist/assets/templates/starter/README.md +0 -48
  75. package/dist/assets/templates/starter/blocks/revenue_by_segment.dql +0 -29
  76. package/dist/assets/templates/starter/blocks/revenue_trend_query_only.dql +0 -20
  77. package/dist/assets/templates/starter/dashboards/.gitkeep +0 -1
  78. package/dist/assets/templates/starter/data/revenue.csv +0 -13
  79. package/dist/assets/templates/starter/dql.config.json +0 -18
  80. package/dist/assets/templates/starter/notebooks/semantic_layer_tutorial.dqlnb +0 -60
  81. package/dist/assets/templates/starter/semantic-layer/blocks/revenue_by_segment.yaml +0 -11
  82. package/dist/assets/templates/starter/semantic-layer/cubes/revenue_cube.yaml +0 -77
  83. package/dist/assets/templates/starter/semantic-layer/dimensions/segment_tier.yaml +0 -6
  84. package/dist/assets/templates/starter/semantic-layer/hierarchies/revenue_time.yaml +0 -12
  85. package/dist/assets/templates/starter/semantic-layer/metrics/revenue.yaml +0 -7
  86. package/dist/assets/templates/starter/workbooks/.gitkeep +0 -1
  87. package/dist/assets/templates/taxi/README.md +0 -31
  88. package/dist/assets/templates/taxi/blocks/airport_mix.dql +0 -25
  89. package/dist/assets/templates/taxi/blocks/revenue_by_segment.dql +0 -24
  90. package/dist/assets/templates/taxi/dashboards/city_operations.dql +0 -25
  91. package/dist/assets/templates/taxi/data/trips.csv +0 -13
  92. package/dist/assets/templates/taxi/dql.config.json +0 -18
  93. package/dist/assets/templates/taxi/semantic-layer/.gitkeep +0 -1
  94. package/dist/assets/templates/taxi/semantic-layer/dimensions/airport_flag.yaml +0 -8
  95. package/dist/assets/templates/taxi/semantic-layer/dimensions/dropoff_borough.yaml +0 -9
  96. package/dist/assets/templates/taxi/semantic-layer/dimensions/payment_type.yaml +0 -8
  97. package/dist/assets/templates/taxi/semantic-layer/dimensions/pickup_borough.yaml +0 -9
  98. package/dist/assets/templates/taxi/semantic-layer/dimensions/pickup_date.yaml +0 -9
  99. package/dist/assets/templates/taxi/semantic-layer/hierarchies/trip_route.yaml +0 -14
  100. package/dist/assets/templates/taxi/semantic-layer/metrics/avg_trip_miles.yaml +0 -10
  101. package/dist/assets/templates/taxi/semantic-layer/metrics/total_fare.yaml +0 -10
  102. package/dist/assets/templates/taxi/semantic-layer/metrics/total_tips.yaml +0 -10
  103. package/dist/assets/templates/taxi/semantic-layer/metrics/trip_count.yaml +0 -10
  104. package/dist/assets/templates/taxi/workbooks/.gitkeep +0 -1
  105. package/dist/assets/templates/workbook/README.md +0 -30
  106. package/dist/assets/templates/workbook/blocks/.gitkeep +0 -1
  107. package/dist/assets/templates/workbook/data/finance.csv +0 -7
  108. package/dist/assets/templates/workbook/dql.config.json +0 -18
  109. package/dist/assets/templates/workbook/semantic-layer/.gitkeep +0 -1
  110. package/dist/assets/templates/workbook/workbooks/quarterly_business_review.dql +0 -32
@@ -1,77 +0,0 @@
1
- # Cube Definition — groups measures, dimensions, time dimensions, and joins
2
- # into a single semantic model. This is the recommended way to define
3
- # complex, multi-table semantic layers.
4
- #
5
- # The DQL notebook will automatically discover this cube and display
6
- # its measures and dimensions in the Semantic Layer sidebar panel.
7
-
8
- name: revenue
9
- label: Revenue Cube
10
- description: Core revenue analysis cube built on the starter revenue data.
11
- table: read_csv_auto('./data/revenue.csv')
12
- domain: revenue
13
- owner: analytics-team
14
-
15
- # Measures — aggregate calculations shown as "Metrics" in the UI
16
- measures:
17
- - name: total_revenue
18
- label: Total Revenue
19
- description: Sum of all recognized revenue.
20
- sql: SUM(amount)
21
- type: sum
22
- tags:
23
- - revenue
24
- - kpi
25
-
26
- - name: deal_count
27
- label: Deal Count
28
- description: Number of revenue deals.
29
- sql: COUNT(*)
30
- type: count
31
-
32
- - name: avg_deal_size
33
- label: Average Deal Size
34
- description: Average revenue per deal.
35
- sql: AVG(amount)
36
- type: avg
37
- tags:
38
- - revenue
39
-
40
- # Dimensions — grouping columns shown as "Dimensions" in the UI
41
- dimensions:
42
- - name: segment_tier
43
- label: Segment Tier
44
- description: Customer segment (Enterprise, Mid-Market, SMB).
45
- sql: segment_tier
46
- type: string
47
-
48
- - name: fiscal_period
49
- label: Fiscal Period
50
- description: Fiscal period classification.
51
- sql: fiscal_period
52
- type: string
53
-
54
- # Time Dimensions — date columns with granularity support (day/week/month/quarter/year)
55
- time_dimensions:
56
- - name: recognized_at
57
- label: Recognition Date
58
- description: Date revenue was recognized.
59
- sql: recognized_at
60
- primary_time: true
61
- granularities:
62
- - day
63
- - week
64
- - month
65
- - quarter
66
- - year
67
-
68
- # Joins — connect this cube to other cubes for cross-table queries
69
- # Example (uncomment if you have a customers cube):
70
- # joins:
71
- # - name: customers
72
- # type: left
73
- # sql: "${left}.customer_id = ${right}.id"
74
-
75
- tags:
76
- - revenue
77
- - starter
@@ -1,6 +0,0 @@
1
- name: segment_tier
2
- label: Segment Tier
3
- description: Customer segment tier
4
- sql: segment_tier
5
- type: string
6
- table: read_csv_auto('./data/revenue.csv')
@@ -1,12 +0,0 @@
1
- name: revenue_time
2
- label: Revenue Time
3
- description: Example fiscal calendar hierarchy
4
- domain: revenue
5
- levels:
6
- - name: fiscal_year
7
- dimension: fiscal_year
8
- order: 1
9
- - name: fiscal_quarter
10
- dimension: fiscal_quarter
11
- order: 2
12
- defaultRollup: sum
@@ -1,7 +0,0 @@
1
- name: total_revenue
2
- label: Total Revenue
3
- description: Sum of recognized revenue
4
- domain: revenue
5
- sql: SUM(amount)
6
- type: sum
7
- table: read_csv_auto('./data/revenue.csv')
@@ -1,31 +0,0 @@
1
- # __PROJECT_NAME__
2
-
3
- This template packages a city mobility analytics sandbox with taxi trip data. It covers trip volume trends, fare analysis, borough breakdowns, and time-series patterns — a strong starting point for operational and geospatial analytics.
4
-
5
- ## Included assets
6
-
7
- - `blocks/revenue_by_segment.dql` — trip volume by pickup borough
8
- - `blocks/airport_mix.dql` — airport trip fare mix
9
- - `dashboards/city_operations.dql` — operations dashboard with fares and trip counts
10
- - `data/trips.csv` — local taxi trip sample dataset
11
- - `notebooks/welcome.dqlnb` — browser notebook walkthrough
12
-
13
- ## Quick start
14
-
15
- ```bash
16
- dql doctor
17
- dql notebook
18
- dql preview blocks/revenue_by_segment.dql --open
19
- ```
20
-
21
- ## What to explore
22
-
23
- - Analyze trip volume and fare trends by borough and time of day
24
- - Compare airport vs. non-airport trip economics
25
- - Build time-series line charts for daily or weekly trip counts
26
-
27
- ## Next Steps
28
-
29
- - [Authoring Blocks](https://github.com/duckcodeailabs/dql/blob/main/docs/authoring-blocks.md) — promote your notebook queries into certified, reusable `.dql` blocks
30
- - [Semantic Layer Guide](https://github.com/duckcodeailabs/dql/blob/main/docs/semantic-layer-guide.md) — define trip-level metrics and borough dimensions in YAML
31
- - [Getting Started](https://github.com/duckcodeailabs/dql/blob/main/docs/getting-started.md) — connect to a cloud database or add DQL to an existing repo
@@ -1,25 +0,0 @@
1
- block "Airport Fare Mix" {
2
- domain = "mobility"
3
- type = "custom"
4
- description = "Average fare for airport versus non-airport trips"
5
- tags = ["taxi", "airport"]
6
- owner = "template"
7
-
8
- query = """
9
- SELECT CASE WHEN airport_flag THEN 'Airport' ELSE 'City' END AS trip_type,
10
- ROUND(AVG(fare_amount), 2) AS avg_fare
11
- FROM read_csv_auto('./data/trips.csv')
12
- GROUP BY trip_type
13
- ORDER BY avg_fare DESC
14
- """
15
-
16
- visualization {
17
- chart = "bar"
18
- x = trip_type
19
- y = avg_fare
20
- }
21
-
22
- tests {
23
- assert row_count > 0
24
- }
25
- }
@@ -1,24 +0,0 @@
1
- block "Trips by Borough" {
2
- domain = "mobility"
3
- type = "custom"
4
- description = "Trip count by pickup borough"
5
- tags = ["taxi", "operations"]
6
- owner = "template"
7
-
8
- query = """
9
- SELECT pickup_borough, COUNT(*) AS revenue
10
- FROM read_csv_auto('./data/trips.csv')
11
- GROUP BY pickup_borough
12
- ORDER BY revenue DESC
13
- """
14
-
15
- visualization {
16
- chart = "bar"
17
- x = pickup_borough
18
- y = revenue
19
- }
20
-
21
- tests {
22
- assert row_count > 0
23
- }
24
- }
@@ -1,25 +0,0 @@
1
- dashboard "City Operations" {
2
- chart.kpi(
3
- SELECT COUNT(*) AS total_trips
4
- FROM read_csv_auto('./data/trips.csv'),
5
- metrics = ["total_trips"],
6
- title = "Total Trips"
7
- )
8
-
9
- chart.line(
10
- SELECT pickup_hour, ROUND(AVG(fare_amount), 2) AS avg_fare
11
- FROM read_csv_auto('./data/trips.csv')
12
- GROUP BY pickup_hour
13
- ORDER BY pickup_hour,
14
- x = pickup_hour,
15
- y = avg_fare,
16
- title = "Average Fare by Hour"
17
- )
18
-
19
- chart.table(
20
- SELECT pickup_date, pickup_borough, dropoff_borough, trip_miles, fare_amount, tip_amount
21
- FROM read_csv_auto('./data/trips.csv')
22
- ORDER BY fare_amount DESC,
23
- title = "Highest Fare Trips"
24
- )
25
- }
@@ -1,13 +0,0 @@
1
- trip_id,pickup_date,pickup_hour,pickup_borough,dropoff_borough,payment_type,fare_amount,tip_amount,trip_miles,airport_flag
2
- T-001,2025-01-03,6,Manhattan,Queens,Card,32.5,6.2,8.4,true
3
- T-002,2025-01-03,7,Brooklyn,Manhattan,Card,21.4,4.1,5.6,false
4
- T-003,2025-01-04,8,Queens,Manhattan,Cash,27.8,0,7.1,true
5
- T-004,2025-01-04,9,Manhattan,Brooklyn,Card,18.9,3.7,4.9,false
6
- T-005,2025-01-05,11,Bronx,Manhattan,Card,25.7,5.1,6.8,false
7
- T-006,2025-01-05,12,Manhattan,Queens,Card,34.2,6.8,8.9,true
8
- T-007,2025-01-06,13,Queens,Brooklyn,Card,19.3,3.5,5.2,false
9
- T-008,2025-01-06,15,Manhattan,Manhattan,Card,14.6,3.2,2.8,false
10
- T-009,2025-01-07,17,Brooklyn,Queens,Cash,16.8,0,4.1,false
11
- T-010,2025-01-07,18,Manhattan,Staten Island,Card,41.1,7.4,12.3,false
12
- T-011,2025-01-08,19,Queens,Manhattan,Card,29.6,5.9,7.7,true
13
- T-012,2025-01-08,21,Brooklyn,Manhattan,Card,22.1,4.6,5.9,false
@@ -1,18 +0,0 @@
1
- {
2
- "project": "__PROJECT_NAME__",
3
- "defaultConnection": {
4
- "driver": "file",
5
- "filepath": ":memory:"
6
- },
7
- "dataDir": "./data",
8
-
9
- "semanticLayer": {
10
- "provider": "dql"
11
- },
12
-
13
- "preview": {
14
- "port": 3474,
15
- "open": true,
16
- "theme": "dark"
17
- }
18
- }
@@ -1,8 +0,0 @@
1
- name: airport_flag
2
- label: Airport Trip
3
- description: Whether the trip was to or from an airport.
4
- sql: airport_flag
5
- type: boolean
6
- table: trips
7
- tags:
8
- - taxi
@@ -1,9 +0,0 @@
1
- name: dropoff_borough
2
- label: Dropoff Borough
3
- description: Borough where the trip ended.
4
- sql: dropoff_borough
5
- type: string
6
- table: trips
7
- tags:
8
- - geo
9
- - taxi
@@ -1,8 +0,0 @@
1
- name: payment_type
2
- label: Payment Type
3
- description: Payment method used (Card, Cash).
4
- sql: payment_type
5
- type: string
6
- table: trips
7
- tags:
8
- - taxi
@@ -1,9 +0,0 @@
1
- name: pickup_borough
2
- label: Pickup Borough
3
- description: Borough where the trip started.
4
- sql: pickup_borough
5
- type: string
6
- table: trips
7
- tags:
8
- - geo
9
- - taxi
@@ -1,9 +0,0 @@
1
- name: pickup_date
2
- label: Pickup Date
3
- description: Date the trip started.
4
- sql: pickup_date
5
- type: date
6
- table: trips
7
- tags:
8
- - time
9
- - taxi
@@ -1,14 +0,0 @@
1
- name: trip_route
2
- label: Trip Route
3
- description: Drill from pickup borough to dropoff borough.
4
- domain: transportation
5
- levels:
6
- - name: pickup_borough
7
- label: Pickup Borough
8
- dimension: pickup_borough
9
- order: 1
10
- - name: dropoff_borough
11
- label: Dropoff Borough
12
- dimension: dropoff_borough
13
- order: 2
14
- defaultRollup: sum
@@ -1,10 +0,0 @@
1
- name: avg_trip_miles
2
- label: Average Trip Miles
3
- description: Average distance per trip.
4
- domain: transportation
5
- sql: AVG(trip_miles)
6
- type: avg
7
- table: trips
8
- tags:
9
- - trips
10
- - taxi
@@ -1,10 +0,0 @@
1
- name: total_fare
2
- label: Total Fare
3
- description: Sum of all fare amounts.
4
- domain: transportation
5
- sql: SUM(fare_amount)
6
- type: sum
7
- table: trips
8
- tags:
9
- - revenue
10
- - taxi
@@ -1,10 +0,0 @@
1
- name: total_tips
2
- label: Total Tips
3
- description: Sum of tip amounts.
4
- domain: transportation
5
- sql: SUM(tip_amount)
6
- type: sum
7
- table: trips
8
- tags:
9
- - revenue
10
- - taxi
@@ -1,10 +0,0 @@
1
- name: trip_count
2
- label: Trip Count
3
- description: Total number of trips.
4
- domain: transportation
5
- sql: COUNT(trip_id)
6
- type: count
7
- table: trips
8
- tags:
9
- - trips
10
- - taxi
@@ -1,30 +0,0 @@
1
- # Workbook
2
-
3
- Multi-page workbook that compiles into a tabbed HTML report.
4
-
5
- ## Scaffold
6
-
7
- ```bash
8
- dql init my-project --template workbook
9
- cd my-project
10
- ```
11
-
12
- ## What it demonstrates
13
-
14
- - Workbook syntax
15
- - Multiple pages in one file
16
- - Local-first reporting flow with CSV data
17
-
18
- ## Run it
19
-
20
- ```bash
21
- dql doctor
22
- dql preview workbooks/quarterly_business_review.dql --open
23
- ```
24
-
25
- ## Build it
26
-
27
- ```bash
28
- dql build workbooks/quarterly_business_review.dql
29
- dql serve dist/quarterly_business_review --open
30
- ```
@@ -1,7 +0,0 @@
1
- month,region,revenue,expense
2
- 2026-01,North America,120000,64000
3
- 2026-01,EMEA,98000,52000
4
- 2026-02,North America,133000,70000
5
- 2026-02,EMEA,105000,56000
6
- 2026-03,North America,141000,73000
7
- 2026-03,EMEA,112000,59000
@@ -1,18 +0,0 @@
1
- {
2
- "project": "__PROJECT_NAME__",
3
- "defaultConnection": {
4
- "driver": "file",
5
- "filepath": ":memory:"
6
- },
7
- "dataDir": "./data",
8
-
9
- "semanticLayer": {
10
- "provider": "dql"
11
- },
12
-
13
- "preview": {
14
- "port": 3474,
15
- "open": true,
16
- "theme": "dark"
17
- }
18
- }
@@ -1,32 +0,0 @@
1
- workbook "Quarterly Business Review" {
2
- page "Executive Summary" {
3
- chart.kpi(
4
- SELECT SUM(revenue) AS total_revenue FROM read_csv_auto('./data/finance.csv'),
5
- metrics = ["total_revenue"],
6
- title = "Total Revenue"
7
- )
8
- }
9
-
10
- page "Revenue Trend" {
11
- chart.line(
12
- SELECT month, SUM(revenue) AS total_revenue
13
- FROM read_csv_auto('./data/finance.csv')
14
- GROUP BY month
15
- ORDER BY month,
16
- x = month,
17
- y = total_revenue,
18
- title = "Revenue Trend"
19
- )
20
- }
21
-
22
- page "Cost by Region" {
23
- chart.bar(
24
- SELECT region, SUM(expense) AS total_expense
25
- FROM read_csv_auto('./data/finance.csv')
26
- GROUP BY region,
27
- x = region,
28
- y = total_expense,
29
- title = "Cost by Region"
30
- )
31
- }
32
- }