@useatlas/create 0.0.2 → 0.0.4
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 +4 -18
- package/index.ts +191 -31
- package/package.json +1 -1
- package/templates/docker/.env.example +3 -3
- package/templates/docker/Dockerfile.sidecar +28 -0
- package/templates/docker/bin/__tests__/plugin-cli.test.ts +9 -9
- package/templates/docker/bin/atlas.ts +108 -44
- package/templates/docker/data/demo-semantic/catalog.yml +51 -27
- package/templates/docker/data/demo-semantic/entities/accounts.yml +95 -103
- package/templates/docker/data/demo-semantic/entities/companies.yml +88 -152
- package/templates/docker/data/demo-semantic/entities/people.yml +82 -95
- package/templates/docker/data/demo-semantic/glossary.yml +104 -8
- package/templates/docker/data/demo-semantic/metrics/accounts.yml +62 -23
- package/templates/docker/data/demo-semantic/metrics/companies.yml +52 -78
- package/templates/docker/docker-compose.yml +1 -1
- package/templates/docker/docs/deploy.md +2 -39
- package/templates/docker/package.json +17 -1
- package/templates/docker/semantic/catalog.yml +62 -3
- package/templates/docker/semantic/entities/accounts.yml +162 -0
- package/templates/docker/semantic/entities/companies.yml +143 -0
- package/templates/docker/semantic/entities/people.yml +132 -0
- package/templates/docker/semantic/glossary.yml +116 -4
- package/templates/docker/semantic/metrics/accounts.yml +77 -0
- package/templates/docker/semantic/metrics/companies.yml +63 -0
- package/templates/docker/sidecar/Dockerfile +5 -6
- package/templates/docker/sidecar/railway.json +1 -2
- package/templates/docker/src/api/__tests__/admin.test.ts +7 -7
- package/templates/docker/src/api/__tests__/health-plugin.test.ts +7 -0
- package/templates/docker/src/api/__tests__/health.test.ts +30 -8
- package/templates/docker/src/api/routes/admin.ts +549 -8
- package/templates/docker/src/api/routes/chat.ts +5 -20
- package/templates/docker/src/api/routes/health.ts +39 -27
- package/templates/docker/src/api/routes/openapi.ts +1329 -74
- package/templates/docker/src/api/routes/query.ts +2 -1
- package/templates/docker/src/api/server.ts +27 -0
- package/templates/docker/src/app/api/[...route]/route.ts +2 -2
- package/templates/docker/src/app/globals.css +13 -12
- package/templates/docker/src/app/layout.tsx +9 -2
- package/templates/docker/src/components/ui/alert-dialog.tsx +196 -0
- package/templates/docker/src/components/ui/badge.tsx +48 -0
- package/templates/docker/src/components/ui/button.tsx +64 -0
- package/templates/docker/src/components/ui/card.tsx +92 -0
- package/templates/docker/src/components/ui/collapsible.tsx +33 -0
- package/templates/docker/src/components/ui/command.tsx +184 -0
- package/templates/docker/src/components/ui/dialog.tsx +158 -0
- package/templates/docker/src/components/ui/dropdown-menu.tsx +257 -0
- package/templates/docker/src/components/ui/input.tsx +21 -0
- package/templates/docker/src/components/ui/scroll-area.tsx +58 -0
- package/templates/docker/src/components/ui/select.tsx +190 -0
- package/templates/docker/src/components/ui/separator.tsx +28 -0
- package/templates/docker/src/components/ui/sheet.tsx +143 -0
- package/templates/docker/src/components/ui/sidebar.tsx +726 -0
- package/templates/docker/src/components/ui/skeleton.tsx +13 -0
- package/templates/docker/src/components/ui/table.tsx +116 -0
- package/templates/docker/src/components/ui/tabs.tsx +91 -0
- package/templates/docker/src/components/ui/toggle-group.tsx +83 -0
- package/templates/docker/src/components/ui/toggle.tsx +47 -0
- package/templates/docker/src/components/ui/tooltip.tsx +57 -0
- package/templates/docker/src/hooks/use-mobile.ts +19 -0
- package/templates/docker/src/lib/__tests__/agent-cache.test.ts +2 -0
- package/templates/docker/src/lib/__tests__/agent-dialect.test.ts +17 -0
- package/templates/docker/src/lib/__tests__/agent-health-annotations.test.ts +2 -0
- package/templates/docker/src/lib/__tests__/agent-integration.test.ts +2 -0
- package/templates/docker/src/lib/__tests__/config.test.ts +69 -19
- package/templates/docker/src/lib/__tests__/plugin-aware-validation.test.ts +321 -0
- package/templates/docker/src/lib/__tests__/providers.test.ts +32 -1
- package/templates/docker/src/lib/__tests__/startup-actions.test.ts +9 -0
- package/templates/docker/src/lib/__tests__/startup-first-run.test.ts +429 -0
- package/templates/docker/src/lib/__tests__/startup.test.ts +5 -0
- package/templates/docker/src/lib/agent-query.ts +5 -23
- package/templates/docker/src/lib/agent.ts +32 -112
- package/templates/docker/src/lib/auth/__tests__/migrate.test.ts +5 -3
- package/templates/docker/src/lib/auth/middleware.ts +30 -4
- package/templates/docker/src/lib/auth/migrate.ts +97 -0
- package/templates/docker/src/lib/auth/server.ts +12 -1
- package/templates/docker/src/lib/config.ts +37 -39
- package/templates/docker/src/lib/db/__tests__/connection.test.ts +89 -14
- package/templates/docker/src/lib/db/__tests__/registry-health.test.ts +1 -18
- package/templates/docker/src/lib/db/__tests__/registry-pool-limits.test.ts +0 -19
- package/templates/docker/src/lib/db/__tests__/registry.test.ts +11 -208
- package/templates/docker/src/lib/db/connection.ts +87 -265
- package/templates/docker/src/lib/db/internal.ts +6 -1
- package/templates/docker/src/lib/plugins/__tests__/hooks-integration.test.ts +3 -1
- package/templates/docker/src/lib/plugins/__tests__/hooks.test.ts +2 -2
- package/templates/docker/src/lib/plugins/__tests__/migrate.test.ts +355 -1
- package/templates/docker/src/lib/plugins/__tests__/registry.test.ts +32 -5
- package/templates/docker/src/lib/plugins/__tests__/wiring.test.ts +228 -14
- package/templates/docker/src/lib/plugins/index.ts +4 -1
- package/templates/docker/src/lib/plugins/migrate.ts +103 -0
- package/templates/docker/src/lib/plugins/registry.ts +12 -6
- package/templates/docker/src/lib/plugins/wiring.ts +113 -4
- package/templates/docker/src/lib/providers.ts +6 -1
- package/templates/docker/src/lib/security.ts +24 -0
- package/templates/docker/src/lib/semantic.ts +2 -0
- package/templates/docker/src/lib/sidecar-types.ts +12 -1
- package/templates/docker/src/lib/startup.ts +71 -101
- package/templates/docker/src/lib/tools/__tests__/custom-validation.test.ts +2 -0
- package/templates/docker/src/lib/tools/__tests__/explore-nsjail.test.ts +32 -18
- package/templates/docker/src/lib/tools/__tests__/explore-plugin.test.ts +14 -14
- package/templates/docker/src/lib/tools/__tests__/explore-sidecar.test.ts +5 -3
- package/templates/docker/src/lib/tools/__tests__/python-nsjail.test.ts +515 -0
- package/templates/docker/src/lib/tools/__tests__/python-sandbox.test.ts +397 -0
- package/templates/docker/src/lib/tools/__tests__/python-sidecar.test.ts +365 -0
- package/templates/docker/src/lib/tools/__tests__/python.test.ts +331 -0
- package/templates/docker/src/lib/tools/__tests__/registry-actions.test.ts +1 -13
- package/templates/docker/src/lib/tools/__tests__/registry.test.ts +38 -31
- package/templates/docker/src/lib/tools/__tests__/sql-audit.test.ts +2 -0
- package/templates/docker/src/lib/tools/__tests__/sql-connection-whitelist.test.ts +2 -0
- package/templates/docker/src/lib/tools/__tests__/sql-ratelimit.test.ts +2 -0
- package/templates/docker/src/lib/tools/__tests__/sql.test.ts +5 -308
- package/templates/docker/src/lib/tools/explore-nsjail.ts +17 -12
- package/templates/docker/src/lib/tools/explore-sidecar.ts +25 -0
- package/templates/docker/src/lib/tools/explore.ts +28 -32
- package/templates/docker/src/lib/tools/python-nsjail.ts +396 -0
- package/templates/docker/src/lib/tools/python-sandbox.ts +476 -0
- package/templates/docker/src/lib/tools/python-sidecar.ts +150 -0
- package/templates/docker/src/lib/tools/python.ts +367 -0
- package/templates/docker/src/lib/tools/registry.ts +49 -22
- package/templates/docker/src/lib/tools/sql.ts +88 -88
- package/templates/docker/src/types/vercel-sandbox.d.ts +7 -0
- package/templates/docker/src/ui/components/admin/admin-layout.tsx +77 -8
- package/templates/docker/src/ui/components/admin/admin-sidebar.tsx +25 -17
- package/templates/docker/src/ui/components/admin/change-password-dialog.tsx +128 -0
- package/templates/docker/src/ui/components/admin/entity-detail.tsx +3 -3
- package/templates/docker/src/ui/components/admin/semantic-file-tree.tsx +159 -0
- package/templates/docker/src/ui/components/atlas-chat.tsx +64 -12
- package/templates/docker/src/ui/components/chart/result-chart.tsx +25 -15
- package/templates/docker/src/ui/components/chat/markdown.tsx +88 -42
- package/templates/docker/src/ui/components/chat/python-result-card.tsx +244 -0
- package/templates/docker/src/ui/components/chat/sql-block.tsx +39 -15
- package/templates/docker/src/ui/components/chat/sql-result-card.tsx +6 -1
- package/templates/docker/src/ui/components/chat/tool-part.tsx +12 -3
- package/templates/docker/src/ui/components/chat/typing-indicator.tsx +5 -2
- package/templates/docker/src/ui/components/conversations/conversation-item.tsx +25 -20
- package/templates/docker/src/ui/context.tsx +1 -1
- package/templates/docker/src/ui/hooks/use-conversations.ts +3 -3
- package/templates/docker/src/ui/hooks/use-dark-mode.ts +17 -10
- package/templates/docker/tsconfig.json +2 -2
- package/templates/nextjs-standalone/.env.example +1 -1
- package/templates/nextjs-standalone/bin/__tests__/plugin-cli.test.ts +9 -9
- package/templates/nextjs-standalone/bin/atlas.ts +108 -44
- package/templates/nextjs-standalone/data/demo-semantic/catalog.yml +51 -27
- package/templates/nextjs-standalone/data/demo-semantic/entities/accounts.yml +95 -103
- package/templates/nextjs-standalone/data/demo-semantic/entities/companies.yml +88 -152
- package/templates/nextjs-standalone/data/demo-semantic/entities/people.yml +82 -95
- package/templates/nextjs-standalone/data/demo-semantic/glossary.yml +104 -8
- package/templates/nextjs-standalone/data/demo-semantic/metrics/accounts.yml +62 -23
- package/templates/nextjs-standalone/data/demo-semantic/metrics/companies.yml +52 -78
- package/templates/nextjs-standalone/docs/deploy.md +2 -39
- package/templates/nextjs-standalone/package.json +11 -2
- package/templates/nextjs-standalone/scripts/migrate-auth.ts +25 -0
- package/templates/nextjs-standalone/scripts/seed-demo.ts +94 -0
- package/templates/nextjs-standalone/semantic/catalog.yml +62 -3
- package/templates/nextjs-standalone/semantic/entities/accounts.yml +162 -0
- package/templates/nextjs-standalone/semantic/entities/companies.yml +143 -0
- package/templates/nextjs-standalone/semantic/entities/people.yml +132 -0
- package/templates/nextjs-standalone/semantic/glossary.yml +116 -4
- package/templates/nextjs-standalone/semantic/metrics/accounts.yml +77 -0
- package/templates/nextjs-standalone/semantic/metrics/companies.yml +63 -0
- package/templates/nextjs-standalone/src/api/__tests__/admin.test.ts +7 -7
- package/templates/nextjs-standalone/src/api/__tests__/health-plugin.test.ts +7 -0
- package/templates/nextjs-standalone/src/api/__tests__/health.test.ts +30 -8
- package/templates/nextjs-standalone/src/api/routes/admin.ts +549 -8
- package/templates/nextjs-standalone/src/api/routes/chat.ts +5 -20
- package/templates/nextjs-standalone/src/api/routes/health.ts +39 -27
- package/templates/nextjs-standalone/src/api/routes/openapi.ts +1329 -74
- package/templates/nextjs-standalone/src/api/routes/query.ts +2 -1
- package/templates/nextjs-standalone/src/api/server.ts +27 -0
- package/templates/nextjs-standalone/src/app/api/[...route]/route.ts +2 -2
- package/templates/nextjs-standalone/src/app/globals.css +13 -12
- package/templates/nextjs-standalone/src/app/layout.tsx +9 -2
- package/templates/nextjs-standalone/src/components/ui/alert-dialog.tsx +196 -0
- package/templates/nextjs-standalone/src/components/ui/badge.tsx +48 -0
- package/templates/nextjs-standalone/src/components/ui/button.tsx +64 -0
- package/templates/nextjs-standalone/src/components/ui/card.tsx +92 -0
- package/templates/nextjs-standalone/src/components/ui/collapsible.tsx +33 -0
- package/templates/nextjs-standalone/src/components/ui/command.tsx +184 -0
- package/templates/nextjs-standalone/src/components/ui/dialog.tsx +158 -0
- package/templates/nextjs-standalone/src/components/ui/dropdown-menu.tsx +257 -0
- package/templates/nextjs-standalone/src/components/ui/input.tsx +21 -0
- package/templates/nextjs-standalone/src/components/ui/scroll-area.tsx +58 -0
- package/templates/nextjs-standalone/src/components/ui/select.tsx +190 -0
- package/templates/nextjs-standalone/src/components/ui/separator.tsx +28 -0
- package/templates/nextjs-standalone/src/components/ui/sheet.tsx +143 -0
- package/templates/nextjs-standalone/src/components/ui/sidebar.tsx +726 -0
- package/templates/nextjs-standalone/src/components/ui/skeleton.tsx +13 -0
- package/templates/nextjs-standalone/src/components/ui/table.tsx +116 -0
- package/templates/nextjs-standalone/src/components/ui/tabs.tsx +91 -0
- package/templates/nextjs-standalone/src/components/ui/toggle-group.tsx +83 -0
- package/templates/nextjs-standalone/src/components/ui/toggle.tsx +47 -0
- package/templates/nextjs-standalone/src/components/ui/tooltip.tsx +57 -0
- package/templates/nextjs-standalone/src/hooks/use-mobile.ts +19 -0
- package/templates/nextjs-standalone/src/lib/__tests__/agent-cache.test.ts +2 -0
- package/templates/nextjs-standalone/src/lib/__tests__/agent-dialect.test.ts +17 -0
- package/templates/nextjs-standalone/src/lib/__tests__/agent-health-annotations.test.ts +2 -0
- package/templates/nextjs-standalone/src/lib/__tests__/agent-integration.test.ts +2 -0
- package/templates/nextjs-standalone/src/lib/__tests__/config.test.ts +69 -19
- package/templates/nextjs-standalone/src/lib/__tests__/plugin-aware-validation.test.ts +321 -0
- package/templates/nextjs-standalone/src/lib/__tests__/providers.test.ts +32 -1
- package/templates/nextjs-standalone/src/lib/__tests__/startup-actions.test.ts +9 -0
- package/templates/nextjs-standalone/src/lib/__tests__/startup-first-run.test.ts +429 -0
- package/templates/nextjs-standalone/src/lib/__tests__/startup.test.ts +5 -0
- package/templates/nextjs-standalone/src/lib/agent-query.ts +5 -23
- package/templates/nextjs-standalone/src/lib/agent.ts +32 -112
- package/templates/nextjs-standalone/src/lib/auth/__tests__/migrate.test.ts +5 -3
- package/templates/nextjs-standalone/src/lib/auth/middleware.ts +30 -4
- package/templates/nextjs-standalone/src/lib/auth/migrate.ts +97 -0
- package/templates/nextjs-standalone/src/lib/auth/server.ts +12 -1
- package/templates/nextjs-standalone/src/lib/config.ts +37 -39
- package/templates/nextjs-standalone/src/lib/db/__tests__/connection.test.ts +89 -14
- package/templates/nextjs-standalone/src/lib/db/__tests__/registry-health.test.ts +1 -18
- package/templates/nextjs-standalone/src/lib/db/__tests__/registry-pool-limits.test.ts +0 -19
- package/templates/nextjs-standalone/src/lib/db/__tests__/registry.test.ts +11 -208
- package/templates/nextjs-standalone/src/lib/db/connection.ts +87 -265
- package/templates/nextjs-standalone/src/lib/db/internal.ts +6 -1
- package/templates/nextjs-standalone/src/lib/plugins/__tests__/hooks-integration.test.ts +3 -1
- package/templates/nextjs-standalone/src/lib/plugins/__tests__/hooks.test.ts +2 -2
- package/templates/nextjs-standalone/src/lib/plugins/__tests__/migrate.test.ts +355 -1
- package/templates/nextjs-standalone/src/lib/plugins/__tests__/registry.test.ts +32 -5
- package/templates/nextjs-standalone/src/lib/plugins/__tests__/wiring.test.ts +228 -14
- package/templates/nextjs-standalone/src/lib/plugins/index.ts +4 -1
- package/templates/nextjs-standalone/src/lib/plugins/migrate.ts +103 -0
- package/templates/nextjs-standalone/src/lib/plugins/registry.ts +12 -6
- package/templates/nextjs-standalone/src/lib/plugins/wiring.ts +113 -4
- package/templates/nextjs-standalone/src/lib/providers.ts +6 -1
- package/templates/nextjs-standalone/src/lib/security.ts +24 -0
- package/templates/nextjs-standalone/src/lib/semantic.ts +2 -0
- package/templates/nextjs-standalone/src/lib/sidecar-types.ts +12 -1
- package/templates/nextjs-standalone/src/lib/startup.ts +71 -101
- package/templates/nextjs-standalone/src/lib/tools/__tests__/custom-validation.test.ts +2 -0
- package/templates/nextjs-standalone/src/lib/tools/__tests__/explore-nsjail.test.ts +32 -18
- package/templates/nextjs-standalone/src/lib/tools/__tests__/explore-plugin.test.ts +14 -14
- package/templates/nextjs-standalone/src/lib/tools/__tests__/explore-sidecar.test.ts +5 -3
- package/templates/nextjs-standalone/src/lib/tools/__tests__/python-nsjail.test.ts +515 -0
- package/templates/nextjs-standalone/src/lib/tools/__tests__/python-sandbox.test.ts +397 -0
- package/templates/nextjs-standalone/src/lib/tools/__tests__/python-sidecar.test.ts +365 -0
- package/templates/nextjs-standalone/src/lib/tools/__tests__/python.test.ts +331 -0
- package/templates/nextjs-standalone/src/lib/tools/__tests__/registry-actions.test.ts +1 -13
- package/templates/nextjs-standalone/src/lib/tools/__tests__/registry.test.ts +38 -31
- package/templates/nextjs-standalone/src/lib/tools/__tests__/sql-audit.test.ts +2 -0
- package/templates/nextjs-standalone/src/lib/tools/__tests__/sql-connection-whitelist.test.ts +2 -0
- package/templates/nextjs-standalone/src/lib/tools/__tests__/sql-ratelimit.test.ts +2 -0
- package/templates/nextjs-standalone/src/lib/tools/__tests__/sql.test.ts +5 -308
- package/templates/nextjs-standalone/src/lib/tools/explore-nsjail.ts +17 -12
- package/templates/nextjs-standalone/src/lib/tools/explore-sidecar.ts +25 -0
- package/templates/nextjs-standalone/src/lib/tools/explore.ts +28 -32
- package/templates/nextjs-standalone/src/lib/tools/python-nsjail.ts +396 -0
- package/templates/nextjs-standalone/src/lib/tools/python-sandbox.ts +476 -0
- package/templates/nextjs-standalone/src/lib/tools/python-sidecar.ts +150 -0
- package/templates/nextjs-standalone/src/lib/tools/python.ts +367 -0
- package/templates/nextjs-standalone/src/lib/tools/registry.ts +49 -22
- package/templates/nextjs-standalone/src/lib/tools/sql.ts +88 -88
- package/templates/nextjs-standalone/src/ui/components/admin/admin-layout.tsx +77 -8
- package/templates/nextjs-standalone/src/ui/components/admin/admin-sidebar.tsx +25 -17
- package/templates/nextjs-standalone/src/ui/components/admin/change-password-dialog.tsx +128 -0
- package/templates/nextjs-standalone/src/ui/components/admin/entity-detail.tsx +3 -3
- package/templates/nextjs-standalone/src/ui/components/admin/semantic-file-tree.tsx +159 -0
- package/templates/nextjs-standalone/src/ui/components/atlas-chat.tsx +64 -12
- package/templates/nextjs-standalone/src/ui/components/chart/result-chart.tsx +25 -15
- package/templates/nextjs-standalone/src/ui/components/chat/markdown.tsx +88 -42
- package/templates/nextjs-standalone/src/ui/components/chat/python-result-card.tsx +244 -0
- package/templates/nextjs-standalone/src/ui/components/chat/sql-block.tsx +39 -15
- package/templates/nextjs-standalone/src/ui/components/chat/sql-result-card.tsx +6 -1
- package/templates/nextjs-standalone/src/ui/components/chat/tool-part.tsx +12 -3
- package/templates/nextjs-standalone/src/ui/components/chat/typing-indicator.tsx +5 -2
- package/templates/nextjs-standalone/src/ui/components/conversations/conversation-item.tsx +25 -20
- package/templates/nextjs-standalone/src/ui/context.tsx +1 -1
- package/templates/nextjs-standalone/src/ui/hooks/use-conversations.ts +3 -3
- package/templates/nextjs-standalone/src/ui/hooks/use-dark-mode.ts +17 -10
- package/templates/nextjs-standalone/tsconfig.json +0 -1
- package/templates/nextjs-standalone/vercel.json +4 -1
- package/templates/docker/render.yaml +0 -34
- package/templates/docker/semantic/entities/.gitkeep +0 -0
- package/templates/docker/semantic/metrics/.gitkeep +0 -0
- package/templates/docker/src/lib/db/__tests__/duckdb.test.ts +0 -141
- package/templates/docker/src/lib/db/__tests__/salesforce.test.ts +0 -339
- package/templates/docker/src/lib/db/__tests__/snowflake.test.ts +0 -217
- package/templates/docker/src/lib/db/duckdb.ts +0 -122
- package/templates/docker/src/lib/db/salesforce.ts +0 -342
- package/templates/docker/src/lib/tools/__tests__/salesforce-tool.test.ts +0 -154
- package/templates/docker/src/lib/tools/__tests__/soql-validation.test.ts +0 -303
- package/templates/docker/src/lib/tools/__tests__/sql-duckdb.test.ts +0 -233
- package/templates/docker/src/lib/tools/salesforce.ts +0 -138
- package/templates/docker/src/lib/tools/soql-validation.ts +0 -172
- package/templates/nextjs-standalone/semantic/entities/.gitkeep +0 -0
- package/templates/nextjs-standalone/semantic/metrics/.gitkeep +0 -0
- package/templates/nextjs-standalone/src/lib/db/__tests__/duckdb.test.ts +0 -141
- package/templates/nextjs-standalone/src/lib/db/__tests__/salesforce.test.ts +0 -339
- package/templates/nextjs-standalone/src/lib/db/__tests__/snowflake.test.ts +0 -217
- package/templates/nextjs-standalone/src/lib/db/duckdb.ts +0 -122
- package/templates/nextjs-standalone/src/lib/db/salesforce.ts +0 -342
- package/templates/nextjs-standalone/src/lib/tools/__tests__/salesforce-tool.test.ts +0 -154
- package/templates/nextjs-standalone/src/lib/tools/__tests__/soql-validation.test.ts +0 -303
- package/templates/nextjs-standalone/src/lib/tools/__tests__/sql-duckdb.test.ts +0 -233
- package/templates/nextjs-standalone/src/lib/tools/salesforce.ts +0 -138
- package/templates/nextjs-standalone/src/lib/tools/soql-validation.ts +0 -172
|
@@ -1,170 +1,162 @@
|
|
|
1
1
|
name: Accounts
|
|
2
2
|
type: fact_table
|
|
3
3
|
table: accounts
|
|
4
|
-
grain: one row per account
|
|
5
|
-
description:
|
|
4
|
+
grain: one row per subscription account
|
|
5
|
+
description: |
|
|
6
|
+
Subscription accounts representing our billing relationship with each customer.
|
|
7
|
+
Each account belongs to one company and has a plan tier (Free, Starter, Pro,
|
|
8
|
+
Enterprise), a billing status (Active, Inactive, Suspended, Churned), and a
|
|
9
|
+
monthly_value representing MRR contribution. Contract dates track the lifecycle.
|
|
10
|
+
A company can have multiple accounts (e.g. separate subscriptions for different teams).
|
|
11
|
+
|
|
6
12
|
dimensions:
|
|
7
13
|
- name: id
|
|
8
14
|
sql: id
|
|
9
15
|
type: number
|
|
10
|
-
description: Primary key
|
|
16
|
+
description: Primary key — unique account identifier
|
|
11
17
|
primary_key: true
|
|
12
|
-
|
|
13
|
-
sample_values:
|
|
14
|
-
- '1'
|
|
15
|
-
- '2'
|
|
16
|
-
- '3'
|
|
17
|
-
- '4'
|
|
18
|
-
- '5'
|
|
19
|
-
- '6'
|
|
20
|
-
- '7'
|
|
21
|
-
- '8'
|
|
18
|
+
|
|
22
19
|
- name: company_id
|
|
23
20
|
sql: company_id
|
|
24
21
|
type: number
|
|
25
|
-
description: Foreign key to companies
|
|
26
|
-
|
|
27
|
-
sample_values:
|
|
28
|
-
- '1'
|
|
29
|
-
- '2'
|
|
30
|
-
- '3'
|
|
31
|
-
- '4'
|
|
32
|
-
- '5'
|
|
33
|
-
- '6'
|
|
34
|
-
- '7'
|
|
35
|
-
- '8'
|
|
22
|
+
description: Foreign key to companies — which customer owns this account
|
|
23
|
+
|
|
36
24
|
- name: plan
|
|
37
25
|
sql: plan
|
|
38
26
|
type: string
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
- Enterprise
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
- Starter
|
|
27
|
+
description: |
|
|
28
|
+
Subscription tier. Determines pricing and feature access.
|
|
29
|
+
Free = $0, Starter = ~$49-89, Pro = ~$299-500, Enterprise = ~$5K-15K.
|
|
30
|
+
sample_values: [Enterprise, Pro, Starter, Free]
|
|
31
|
+
|
|
45
32
|
- name: status
|
|
46
33
|
sql: status
|
|
47
34
|
type: string
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
- Suspended
|
|
35
|
+
description: |
|
|
36
|
+
Current billing status. Active = paying, Inactive = paused,
|
|
37
|
+
Suspended = payment issue, Churned = cancelled.
|
|
38
|
+
sample_values: [Active, Churned, Inactive, Suspended]
|
|
39
|
+
|
|
54
40
|
- name: monthly_value
|
|
55
41
|
sql: monthly_value
|
|
56
42
|
type: number
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
- '59'
|
|
62
|
-
- '69'
|
|
63
|
-
- '79'
|
|
64
|
-
- '89'
|
|
65
|
-
- '299'
|
|
66
|
-
- '350'
|
|
43
|
+
description: |
|
|
44
|
+
Monthly Recurring Revenue (MRR) from this account in dollars.
|
|
45
|
+
Free accounts have $0. This is the core revenue metric.
|
|
46
|
+
|
|
67
47
|
- name: contract_start
|
|
68
48
|
sql: contract_start
|
|
69
49
|
type: date
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
- Sat Jun 01 2019 00:00:00 GMT-0400 (Eastern Daylight Time)
|
|
73
|
-
- Thu Aug 01 2019 00:00:00 GMT-0400 (Eastern Daylight Time)
|
|
74
|
-
- Fri Nov 01 2019 00:00:00 GMT-0400 (Eastern Daylight Time)
|
|
75
|
-
- Wed Jan 01 2020 00:00:00 GMT-0500 (Eastern Standard Time)
|
|
76
|
-
- Sat Feb 01 2020 00:00:00 GMT-0500 (Eastern Standard Time)
|
|
77
|
-
- Sun Mar 01 2020 00:00:00 GMT-0500 (Eastern Standard Time)
|
|
78
|
-
- Wed Apr 01 2020 00:00:00 GMT-0400 (Eastern Daylight Time)
|
|
79
|
-
- Fri May 01 2020 00:00:00 GMT-0400 (Eastern Daylight Time)
|
|
50
|
+
description: Date the subscription began
|
|
51
|
+
|
|
80
52
|
- name: contract_end
|
|
81
53
|
sql: contract_end
|
|
82
54
|
type: date
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
- Sat May 01 2021 00:00:00 GMT-0400 (Eastern Daylight Time)
|
|
88
|
-
- Wed Feb 01 2023 00:00:00 GMT-0500 (Eastern Standard Time)
|
|
89
|
-
- Wed Mar 01 2023 00:00:00 GMT-0500 (Eastern Standard Time)
|
|
90
|
-
- Sat Apr 01 2023 00:00:00 GMT-0400 (Eastern Daylight Time)
|
|
91
|
-
- Mon May 01 2023 00:00:00 GMT-0400 (Eastern Daylight Time)
|
|
92
|
-
- Thu Jun 01 2023 00:00:00 GMT-0400 (Eastern Daylight Time)
|
|
93
|
-
- Tue Aug 01 2023 00:00:00 GMT-0400 (Eastern Daylight Time)
|
|
55
|
+
description: |
|
|
56
|
+
Date the subscription ended. NULL means the account is still under contract.
|
|
57
|
+
Set when an account churns or is terminated.
|
|
58
|
+
|
|
94
59
|
- name: monthly_value_bucket
|
|
95
60
|
sql: |-
|
|
96
61
|
CASE
|
|
97
|
-
WHEN monthly_value
|
|
98
|
-
WHEN monthly_value <
|
|
62
|
+
WHEN monthly_value = 0 THEN 'Free'
|
|
63
|
+
WHEN monthly_value < 100 THEN 'Low'
|
|
64
|
+
WHEN monthly_value < 1000 THEN 'Mid'
|
|
99
65
|
ELSE 'High'
|
|
100
66
|
END
|
|
101
67
|
type: string
|
|
102
|
-
description:
|
|
68
|
+
description: MRR tier bucket — Free / Low / Mid / High
|
|
103
69
|
virtual: true
|
|
104
|
-
sample_values:
|
|
105
|
-
|
|
106
|
-
- Medium
|
|
107
|
-
- High
|
|
70
|
+
sample_values: [Free, Low, Mid, High]
|
|
71
|
+
|
|
108
72
|
- name: contract_start_year
|
|
109
73
|
sql: EXTRACT(YEAR FROM contract_start)
|
|
110
74
|
type: number
|
|
111
|
-
description: Year
|
|
75
|
+
description: Year the contract started — useful for cohort analysis
|
|
112
76
|
virtual: true
|
|
77
|
+
|
|
113
78
|
- name: contract_start_month
|
|
114
79
|
sql: TO_CHAR(contract_start, 'YYYY-MM')
|
|
115
80
|
type: string
|
|
116
|
-
description: Year-month
|
|
81
|
+
description: Year-month the contract started
|
|
117
82
|
virtual: true
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
- name: contract_end_month
|
|
124
|
-
sql: TO_CHAR(contract_end, 'YYYY-MM')
|
|
125
|
-
type: string
|
|
126
|
-
description: Year-month extracted from contract_end
|
|
83
|
+
|
|
84
|
+
- name: is_churned
|
|
85
|
+
sql: CASE WHEN status = 'Churned' THEN true ELSE false END
|
|
86
|
+
type: boolean
|
|
87
|
+
description: Whether this account has churned
|
|
127
88
|
virtual: true
|
|
89
|
+
|
|
128
90
|
measures:
|
|
129
91
|
- name: account_count
|
|
130
92
|
sql: id
|
|
131
93
|
type: count_distinct
|
|
132
|
-
|
|
94
|
+
description: Number of unique accounts
|
|
95
|
+
|
|
96
|
+
- name: total_mrr
|
|
133
97
|
sql: monthly_value
|
|
134
98
|
type: sum
|
|
135
|
-
description:
|
|
136
|
-
|
|
99
|
+
description: Total Monthly Recurring Revenue
|
|
100
|
+
|
|
101
|
+
- name: avg_mrr
|
|
137
102
|
sql: monthly_value
|
|
138
103
|
type: avg
|
|
139
|
-
description: Average
|
|
104
|
+
description: Average MRR per account
|
|
105
|
+
|
|
140
106
|
joins:
|
|
141
107
|
- target_entity: Companies
|
|
142
108
|
relationship: many_to_one
|
|
143
109
|
join_columns:
|
|
144
110
|
from: company_id
|
|
145
111
|
to: id
|
|
146
|
-
description: Each account belongs to one company
|
|
112
|
+
description: Each account belongs to one company (customer)
|
|
113
|
+
|
|
147
114
|
use_cases:
|
|
148
|
-
-
|
|
149
|
-
-
|
|
150
|
-
-
|
|
151
|
-
-
|
|
115
|
+
- MRR analysis — total, by plan, by status, over time
|
|
116
|
+
- Churn analysis — churned vs active accounts, churn rate by plan
|
|
117
|
+
- Revenue segmentation — which plans drive the most revenue
|
|
118
|
+
- Contract lifecycle — average duration, upcoming renewals
|
|
119
|
+
- Cross-entity joins to companies for firmographic revenue analysis
|
|
120
|
+
|
|
152
121
|
query_patterns:
|
|
153
|
-
-
|
|
122
|
+
- name: mrr_by_plan
|
|
123
|
+
description: Total MRR and account count by plan tier
|
|
154
124
|
sql: |-
|
|
155
|
-
SELECT plan,
|
|
125
|
+
SELECT plan,
|
|
126
|
+
SUM(monthly_value) AS total_mrr,
|
|
127
|
+
COUNT(*) AS account_count,
|
|
128
|
+
AVG(monthly_value) AS avg_mrr
|
|
156
129
|
FROM accounts
|
|
130
|
+
WHERE status = 'Active'
|
|
157
131
|
GROUP BY plan
|
|
158
|
-
ORDER BY
|
|
159
|
-
|
|
132
|
+
ORDER BY total_mrr DESC
|
|
133
|
+
|
|
134
|
+
- name: churn_rate_by_plan
|
|
135
|
+
description: Churn rate by plan type
|
|
160
136
|
sql: |-
|
|
161
|
-
SELECT
|
|
137
|
+
SELECT plan,
|
|
138
|
+
COUNT(*) FILTER (WHERE status = 'Churned') AS churned,
|
|
139
|
+
COUNT(*) AS total,
|
|
140
|
+
ROUND(100.0 * COUNT(*) FILTER (WHERE status = 'Churned') / COUNT(*), 1) AS churn_pct
|
|
141
|
+
FROM accounts
|
|
142
|
+
GROUP BY plan
|
|
143
|
+
ORDER BY churn_pct DESC
|
|
144
|
+
|
|
145
|
+
- name: accounts_by_status
|
|
146
|
+
description: Account distribution by billing status
|
|
147
|
+
sql: |-
|
|
148
|
+
SELECT status, COUNT(*) AS count
|
|
162
149
|
FROM accounts
|
|
163
150
|
GROUP BY status
|
|
164
151
|
ORDER BY count DESC
|
|
165
|
-
|
|
152
|
+
|
|
153
|
+
- name: mrr_by_contract_year
|
|
154
|
+
description: MRR cohort analysis by contract start year
|
|
166
155
|
sql: |-
|
|
167
|
-
SELECT
|
|
156
|
+
SELECT EXTRACT(YEAR FROM contract_start) AS cohort_year,
|
|
157
|
+
SUM(monthly_value) AS total_mrr,
|
|
158
|
+
COUNT(*) AS accounts
|
|
168
159
|
FROM accounts
|
|
169
|
-
|
|
170
|
-
|
|
160
|
+
WHERE status = 'Active'
|
|
161
|
+
GROUP BY cohort_year
|
|
162
|
+
ORDER BY cohort_year
|
|
@@ -1,207 +1,143 @@
|
|
|
1
1
|
name: Companies
|
|
2
|
-
type:
|
|
2
|
+
type: dimension_table
|
|
3
3
|
table: companies
|
|
4
|
-
grain: one row per company
|
|
5
|
-
description:
|
|
4
|
+
grain: one row per customer company
|
|
5
|
+
description: |
|
|
6
|
+
Customer companies (our B2B clients). Contains firmographic data including
|
|
7
|
+
industry vertical, headcount, founding year, HQ country, annual revenue,
|
|
8
|
+
and valuation. Each company can have multiple accounts (subscriptions)
|
|
9
|
+
and multiple people (contacts). This is the central dimension table for
|
|
10
|
+
customer-level analysis.
|
|
11
|
+
|
|
6
12
|
dimensions:
|
|
7
13
|
- name: id
|
|
8
14
|
sql: id
|
|
9
15
|
type: number
|
|
10
|
-
description: Primary key
|
|
16
|
+
description: Primary key — unique company identifier
|
|
11
17
|
primary_key: true
|
|
12
|
-
|
|
13
|
-
sample_values:
|
|
14
|
-
- '1'
|
|
15
|
-
- '2'
|
|
16
|
-
- '3'
|
|
17
|
-
- '4'
|
|
18
|
-
- '5'
|
|
19
|
-
- '6'
|
|
20
|
-
- '7'
|
|
21
|
-
- '8'
|
|
18
|
+
|
|
22
19
|
- name: name
|
|
23
20
|
sql: name
|
|
24
21
|
type: string
|
|
25
|
-
|
|
26
|
-
sample_values:
|
|
27
|
-
|
|
28
|
-
- AdTech Global
|
|
29
|
-
- AutoForge
|
|
30
|
-
- BioGenix
|
|
31
|
-
- BrightMinds
|
|
32
|
-
- CartFlow
|
|
33
|
-
- CastMedia
|
|
34
|
-
- CleanJoule
|
|
22
|
+
description: Company name
|
|
23
|
+
sample_values: [Acme Corp, DataFlow Inc, CloudSync, RetailHub]
|
|
24
|
+
|
|
35
25
|
- name: industry
|
|
36
26
|
sql: industry
|
|
37
27
|
type: string
|
|
38
|
-
|
|
39
|
-
sample_values:
|
|
40
|
-
|
|
41
|
-
- Energy
|
|
42
|
-
- Finance
|
|
43
|
-
- Healthcare
|
|
44
|
-
- Manufacturing
|
|
45
|
-
- Media
|
|
46
|
-
- Retail
|
|
47
|
-
- Technology
|
|
28
|
+
description: Business sector / vertical
|
|
29
|
+
sample_values: [Education, Energy, Finance, Healthcare, Manufacturing, Media, Retail, Technology]
|
|
30
|
+
|
|
48
31
|
- name: employee_count
|
|
49
32
|
sql: employee_count
|
|
50
33
|
type: number
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
- '50'
|
|
54
|
-
- '55'
|
|
55
|
-
- '60'
|
|
56
|
-
- '65'
|
|
57
|
-
- '70'
|
|
58
|
-
- '75'
|
|
59
|
-
- '80'
|
|
60
|
-
- '85'
|
|
34
|
+
description: Total headcount at the company
|
|
35
|
+
|
|
61
36
|
- name: founded_year
|
|
62
37
|
sql: founded_year
|
|
63
38
|
type: number
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
- '2004'
|
|
67
|
-
- '2005'
|
|
68
|
-
- '2006'
|
|
69
|
-
- '2007'
|
|
70
|
-
- '2008'
|
|
71
|
-
- '2009'
|
|
72
|
-
- '2010'
|
|
73
|
-
- '2011'
|
|
39
|
+
description: Year the company was founded
|
|
40
|
+
|
|
74
41
|
- name: country
|
|
75
42
|
sql: country
|
|
76
43
|
type: string
|
|
77
|
-
|
|
78
|
-
sample_values:
|
|
79
|
-
|
|
80
|
-
- BR
|
|
81
|
-
- CA
|
|
82
|
-
- DE
|
|
83
|
-
- FR
|
|
84
|
-
- IN
|
|
85
|
-
- JP
|
|
86
|
-
- SG
|
|
44
|
+
description: ISO 2-letter code for company HQ location
|
|
45
|
+
sample_values: [AU, BR, CA, DE, FR, IN, JP, SG, UK, US]
|
|
46
|
+
|
|
87
47
|
- name: revenue
|
|
88
48
|
sql: revenue
|
|
89
49
|
type: number
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
- '2000000'
|
|
93
|
-
- '2500000'
|
|
94
|
-
- '3500000'
|
|
95
|
-
- '4000000'
|
|
96
|
-
- '5000000'
|
|
97
|
-
- '6000000'
|
|
98
|
-
- '6500000'
|
|
99
|
-
- '7000000'
|
|
50
|
+
description: Annual revenue in dollars (the company's own revenue, not what they pay us)
|
|
51
|
+
|
|
100
52
|
- name: valuation
|
|
101
53
|
sql: valuation
|
|
102
54
|
type: number
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
- '20000000'
|
|
107
|
-
- '25000000'
|
|
108
|
-
- '28000000'
|
|
109
|
-
- '30000000'
|
|
110
|
-
- '32000000'
|
|
111
|
-
- '35000000'
|
|
112
|
-
- '40000000'
|
|
113
|
-
- name: employee_count_bucket
|
|
55
|
+
description: Company valuation in dollars
|
|
56
|
+
|
|
57
|
+
- name: company_size
|
|
114
58
|
sql: |-
|
|
115
59
|
CASE
|
|
116
|
-
WHEN employee_count <
|
|
117
|
-
WHEN employee_count <
|
|
118
|
-
ELSE '
|
|
60
|
+
WHEN employee_count < 100 THEN 'Small'
|
|
61
|
+
WHEN employee_count < 300 THEN 'Mid-Market'
|
|
62
|
+
ELSE 'Enterprise'
|
|
119
63
|
END
|
|
120
64
|
type: string
|
|
121
|
-
description:
|
|
65
|
+
description: Company size segment based on headcount
|
|
122
66
|
virtual: true
|
|
123
|
-
sample_values:
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
- High
|
|
127
|
-
- name: founded_year_bucket
|
|
67
|
+
sample_values: [Small, Mid-Market, Enterprise]
|
|
68
|
+
|
|
69
|
+
- name: revenue_tier
|
|
128
70
|
sql: |-
|
|
129
71
|
CASE
|
|
130
|
-
WHEN
|
|
131
|
-
WHEN
|
|
132
|
-
|
|
72
|
+
WHEN revenue < 10000000 THEN 'Under $10M'
|
|
73
|
+
WHEN revenue < 50000000 THEN '$10M-$50M'
|
|
74
|
+
WHEN revenue < 100000000 THEN '$50M-$100M'
|
|
75
|
+
ELSE '$100M+'
|
|
133
76
|
END
|
|
134
77
|
type: string
|
|
135
|
-
description:
|
|
78
|
+
description: Revenue tier for segmentation
|
|
136
79
|
virtual: true
|
|
137
|
-
sample_values:
|
|
138
|
-
|
|
139
|
-
- Medium
|
|
140
|
-
- High
|
|
141
|
-
- name: revenue_bucket
|
|
142
|
-
sql: |-
|
|
143
|
-
CASE
|
|
144
|
-
WHEN revenue < (SELECT PERCENTILE_CONT(0.33) WITHIN GROUP (ORDER BY revenue) FROM companies) THEN 'Low'
|
|
145
|
-
WHEN revenue < (SELECT PERCENTILE_CONT(0.66) WITHIN GROUP (ORDER BY revenue) FROM companies) THEN 'Medium'
|
|
146
|
-
ELSE 'High'
|
|
147
|
-
END
|
|
148
|
-
type: string
|
|
149
|
-
description: revenue bucketed into Low/Medium/High terciles
|
|
150
|
-
virtual: true
|
|
151
|
-
sample_values:
|
|
152
|
-
- Low
|
|
153
|
-
- Medium
|
|
154
|
-
- High
|
|
155
|
-
- name: valuation_bucket
|
|
156
|
-
sql: |-
|
|
157
|
-
CASE
|
|
158
|
-
WHEN valuation < (SELECT PERCENTILE_CONT(0.33) WITHIN GROUP (ORDER BY valuation) FROM companies) THEN 'Low'
|
|
159
|
-
WHEN valuation < (SELECT PERCENTILE_CONT(0.66) WITHIN GROUP (ORDER BY valuation) FROM companies) THEN 'Medium'
|
|
160
|
-
ELSE 'High'
|
|
161
|
-
END
|
|
162
|
-
type: string
|
|
163
|
-
description: valuation bucketed into Low/Medium/High terciles
|
|
164
|
-
virtual: true
|
|
165
|
-
sample_values:
|
|
166
|
-
- Low
|
|
167
|
-
- Medium
|
|
168
|
-
- High
|
|
80
|
+
sample_values: [Under $10M, $10M-$50M, $50M-$100M, $100M+]
|
|
81
|
+
|
|
169
82
|
measures:
|
|
170
83
|
- name: company_count
|
|
171
84
|
sql: id
|
|
172
85
|
type: count_distinct
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
type: sum
|
|
176
|
-
description: Sum of employee count
|
|
86
|
+
description: Number of unique companies
|
|
87
|
+
|
|
177
88
|
- name: avg_employee_count
|
|
178
89
|
sql: employee_count
|
|
179
90
|
type: avg
|
|
180
|
-
description: Average
|
|
181
|
-
|
|
182
|
-
sql: founded_year
|
|
183
|
-
type: sum
|
|
184
|
-
description: Sum of founded year
|
|
185
|
-
- name: avg_founded_year
|
|
186
|
-
sql: founded_year
|
|
187
|
-
type: avg
|
|
188
|
-
description: Average founded year
|
|
91
|
+
description: Average headcount per company
|
|
92
|
+
|
|
189
93
|
- name: total_revenue
|
|
190
94
|
sql: revenue
|
|
191
95
|
type: sum
|
|
192
|
-
description:
|
|
96
|
+
description: Combined annual revenue of all companies
|
|
97
|
+
|
|
193
98
|
- name: avg_revenue
|
|
194
99
|
sql: revenue
|
|
195
100
|
type: avg
|
|
196
|
-
description: Average revenue
|
|
197
|
-
|
|
198
|
-
sql: valuation
|
|
199
|
-
type: sum
|
|
200
|
-
description: Sum of valuation
|
|
101
|
+
description: Average annual revenue per company
|
|
102
|
+
|
|
201
103
|
- name: avg_valuation
|
|
202
104
|
sql: valuation
|
|
203
105
|
type: avg
|
|
204
|
-
description: Average valuation
|
|
106
|
+
description: Average company valuation
|
|
107
|
+
|
|
205
108
|
use_cases:
|
|
206
|
-
-
|
|
207
|
-
-
|
|
109
|
+
- Customer segmentation by industry, country, company size
|
|
110
|
+
- Revenue and valuation analysis across the customer base
|
|
111
|
+
- Firmographic profiling for ICP (ideal customer profile) analysis
|
|
112
|
+
- Join to accounts for revenue-per-company analysis
|
|
113
|
+
- Join to people for stakeholder density per company
|
|
114
|
+
|
|
115
|
+
query_patterns:
|
|
116
|
+
- name: companies_by_industry
|
|
117
|
+
description: Customer count and avg revenue by industry
|
|
118
|
+
sql: |-
|
|
119
|
+
SELECT industry,
|
|
120
|
+
COUNT(*) AS company_count,
|
|
121
|
+
AVG(revenue) AS avg_revenue,
|
|
122
|
+
AVG(employee_count) AS avg_headcount
|
|
123
|
+
FROM companies
|
|
124
|
+
GROUP BY industry
|
|
125
|
+
ORDER BY company_count DESC
|
|
126
|
+
|
|
127
|
+
- name: companies_by_country
|
|
128
|
+
description: Customer distribution by country
|
|
129
|
+
sql: |-
|
|
130
|
+
SELECT country,
|
|
131
|
+
COUNT(*) AS company_count,
|
|
132
|
+
SUM(revenue) AS total_revenue
|
|
133
|
+
FROM companies
|
|
134
|
+
GROUP BY country
|
|
135
|
+
ORDER BY company_count DESC
|
|
136
|
+
|
|
137
|
+
- name: top_companies_by_revenue
|
|
138
|
+
description: Largest customers by annual revenue
|
|
139
|
+
sql: |-
|
|
140
|
+
SELECT name, industry, country, revenue, employee_count
|
|
141
|
+
FROM companies
|
|
142
|
+
ORDER BY revenue DESC
|
|
143
|
+
LIMIT 10
|