@useatlas/create 0.0.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.
- package/README.md +231 -0
- package/index.ts +829 -0
- package/package.json +38 -0
- package/templates/docker/.env.example +67 -0
- package/templates/docker/Dockerfile +52 -0
- package/templates/docker/bin/__tests__/benchmark.test.ts +598 -0
- package/templates/docker/bin/__tests__/duckdb-ingest.test.ts +171 -0
- package/templates/docker/bin/__tests__/eval.test.ts +434 -0
- package/templates/docker/bin/__tests__/matview-partition.test.ts +615 -0
- package/templates/docker/bin/__tests__/multi-source.test.ts +113 -0
- package/templates/docker/bin/__tests__/plugin-cli.test.ts +322 -0
- package/templates/docker/bin/__tests__/profiler-heuristics.test.ts +608 -0
- package/templates/docker/bin/__tests__/query.test.ts +240 -0
- package/templates/docker/bin/__tests__/schema-drift.test.ts +542 -0
- package/templates/docker/bin/__tests__/view-yaml-generation.test.ts +146 -0
- package/templates/docker/bin/atlas.ts +5044 -0
- package/templates/docker/bin/benchmark.ts +695 -0
- package/templates/docker/bin/enrich.ts +559 -0
- package/templates/docker/bin/eval.ts +770 -0
- package/templates/docker/bin/smoke.ts +438 -0
- package/templates/docker/data/.gitkeep +0 -0
- package/templates/docker/data/cybersec.sql +1961 -0
- package/templates/docker/data/demo-semantic/catalog.yml +40 -0
- package/templates/docker/data/demo-semantic/entities/accounts.yml +170 -0
- package/templates/docker/data/demo-semantic/entities/companies.yml +207 -0
- package/templates/docker/data/demo-semantic/entities/people.yml +145 -0
- package/templates/docker/data/demo-semantic/glossary.yml +22 -0
- package/templates/docker/data/demo-semantic/metrics/accounts.yml +38 -0
- package/templates/docker/data/demo-semantic/metrics/companies.yml +89 -0
- package/templates/docker/data/demo.sql +373 -0
- package/templates/docker/data/ecommerce.sql +1690 -0
- package/templates/docker/data/init-demo-db.sql +8 -0
- package/templates/docker/docker-compose.yml +34 -0
- package/templates/docker/docs/deploy.md +390 -0
- package/templates/docker/eslint.config.mjs +18 -0
- package/templates/docker/gitignore +5 -0
- package/templates/docker/next.config.ts +9 -0
- package/templates/docker/package.json +59 -0
- package/templates/docker/postcss.config.mjs +8 -0
- package/templates/docker/public/.gitkeep +0 -0
- package/templates/docker/public/favicon.svg +4 -0
- package/templates/docker/railway.json +13 -0
- package/templates/docker/render.yaml +34 -0
- package/templates/docker/semantic/catalog.yml +5 -0
- package/templates/docker/semantic/entities/.gitkeep +0 -0
- package/templates/docker/semantic/glossary.yml +6 -0
- package/templates/docker/semantic/metrics/.gitkeep +0 -0
- package/templates/docker/sidecar/Dockerfile +28 -0
- package/templates/docker/sidecar/railway.json +14 -0
- package/templates/docker/sidecar/server.ts +188 -0
- package/templates/docker/src/api/__tests__/actions.test.ts +683 -0
- package/templates/docker/src/api/__tests__/admin.test.ts +820 -0
- package/templates/docker/src/api/__tests__/auth.test.ts +165 -0
- package/templates/docker/src/api/__tests__/chat.test.ts +376 -0
- package/templates/docker/src/api/__tests__/conversations.test.ts +555 -0
- package/templates/docker/src/api/__tests__/cors.test.ts +135 -0
- package/templates/docker/src/api/__tests__/health-plugin.test.ts +169 -0
- package/templates/docker/src/api/__tests__/health.test.ts +261 -0
- package/templates/docker/src/api/__tests__/query.test.ts +891 -0
- package/templates/docker/src/api/__tests__/scheduled-tasks.test.ts +601 -0
- package/templates/docker/src/api/__tests__/slack.test.ts +847 -0
- package/templates/docker/src/api/index.ts +117 -0
- package/templates/docker/src/api/routes/actions.ts +274 -0
- package/templates/docker/src/api/routes/admin.ts +757 -0
- package/templates/docker/src/api/routes/auth.ts +48 -0
- package/templates/docker/src/api/routes/chat.ts +465 -0
- package/templates/docker/src/api/routes/conversations.ts +266 -0
- package/templates/docker/src/api/routes/health.ts +287 -0
- package/templates/docker/src/api/routes/openapi.ts +390 -0
- package/templates/docker/src/api/routes/query.ts +318 -0
- package/templates/docker/src/api/routes/scheduled-tasks.ts +467 -0
- package/templates/docker/src/api/routes/slack.ts +611 -0
- package/templates/docker/src/api/server.ts +226 -0
- package/templates/docker/src/app/api/[...route]/route.ts +33 -0
- package/templates/docker/src/app/error.tsx +24 -0
- package/templates/docker/src/app/globals.css +126 -0
- package/templates/docker/src/app/layout.tsx +19 -0
- package/templates/docker/src/app/page.tsx +14 -0
- package/templates/docker/src/global.d.ts +1 -0
- package/templates/docker/src/lib/__tests__/agent-cache.test.ts +437 -0
- package/templates/docker/src/lib/__tests__/agent-dialect.test.ts +114 -0
- package/templates/docker/src/lib/__tests__/agent-health-annotations.test.ts +164 -0
- package/templates/docker/src/lib/__tests__/agent-integration.test.ts +514 -0
- package/templates/docker/src/lib/__tests__/config-actions.test.ts +166 -0
- package/templates/docker/src/lib/__tests__/config.test.ts +1063 -0
- package/templates/docker/src/lib/__tests__/conversations.test.ts +589 -0
- package/templates/docker/src/lib/__tests__/errors.test.ts +256 -0
- package/templates/docker/src/lib/__tests__/logger.test.ts +200 -0
- package/templates/docker/src/lib/__tests__/providers.test.ts +99 -0
- package/templates/docker/src/lib/__tests__/rls.test.ts +435 -0
- package/templates/docker/src/lib/__tests__/scheduled-task-types.test.ts +124 -0
- package/templates/docker/src/lib/__tests__/scheduled-tasks.test.ts +550 -0
- package/templates/docker/src/lib/__tests__/semantic-index.test.ts +547 -0
- package/templates/docker/src/lib/__tests__/semantic-multisource.test.ts +544 -0
- package/templates/docker/src/lib/__tests__/semantic.test.ts +363 -0
- package/templates/docker/src/lib/__tests__/startup-actions.test.ts +452 -0
- package/templates/docker/src/lib/__tests__/startup.test.ts +465 -0
- package/templates/docker/src/lib/__tests__/tracing.test.ts +28 -0
- package/templates/docker/src/lib/action-types.ts +95 -0
- package/templates/docker/src/lib/agent-query.ts +178 -0
- package/templates/docker/src/lib/agent.ts +505 -0
- package/templates/docker/src/lib/api-url.ts +2 -0
- package/templates/docker/src/lib/auth/__tests__/audit.test.ts +418 -0
- package/templates/docker/src/lib/auth/__tests__/byot-integration.test.ts +222 -0
- package/templates/docker/src/lib/auth/__tests__/byot.test.ts +366 -0
- package/templates/docker/src/lib/auth/__tests__/detect.test.ts +190 -0
- package/templates/docker/src/lib/auth/__tests__/managed.test.ts +173 -0
- package/templates/docker/src/lib/auth/__tests__/middleware.test.ts +456 -0
- package/templates/docker/src/lib/auth/__tests__/migrate.test.ts +201 -0
- package/templates/docker/src/lib/auth/__tests__/permissions.test.ts +225 -0
- package/templates/docker/src/lib/auth/__tests__/server.test.ts +34 -0
- package/templates/docker/src/lib/auth/__tests__/simple-key.test.ts +176 -0
- package/templates/docker/src/lib/auth/__tests__/types.test.ts +44 -0
- package/templates/docker/src/lib/auth/audit.ts +89 -0
- package/templates/docker/src/lib/auth/byot.ts +158 -0
- package/templates/docker/src/lib/auth/client.ts +35 -0
- package/templates/docker/src/lib/auth/detect.ts +83 -0
- package/templates/docker/src/lib/auth/managed.ts +73 -0
- package/templates/docker/src/lib/auth/middleware.ts +208 -0
- package/templates/docker/src/lib/auth/migrate.ts +111 -0
- package/templates/docker/src/lib/auth/permissions.ts +156 -0
- package/templates/docker/src/lib/auth/server.ts +142 -0
- package/templates/docker/src/lib/auth/simple-key.ts +92 -0
- package/templates/docker/src/lib/auth/types.ts +49 -0
- package/templates/docker/src/lib/config.ts +704 -0
- package/templates/docker/src/lib/conversation-types.ts +29 -0
- package/templates/docker/src/lib/conversations.ts +270 -0
- package/templates/docker/src/lib/db/__tests__/connection.test.ts +69 -0
- package/templates/docker/src/lib/db/__tests__/duckdb.test.ts +141 -0
- package/templates/docker/src/lib/db/__tests__/internal.test.ts +387 -0
- package/templates/docker/src/lib/db/__tests__/registry-health.test.ts +207 -0
- package/templates/docker/src/lib/db/__tests__/registry-pool-limits.test.ts +156 -0
- package/templates/docker/src/lib/db/__tests__/registry.test.ts +595 -0
- package/templates/docker/src/lib/db/__tests__/salesforce.test.ts +339 -0
- package/templates/docker/src/lib/db/__tests__/snowflake.test.ts +217 -0
- package/templates/docker/src/lib/db/__tests__/source-rate-limit.test.ts +130 -0
- package/templates/docker/src/lib/db/connection.ts +753 -0
- package/templates/docker/src/lib/db/duckdb.ts +122 -0
- package/templates/docker/src/lib/db/internal.ts +273 -0
- package/templates/docker/src/lib/db/salesforce.ts +342 -0
- package/templates/docker/src/lib/db/source-rate-limit.ts +191 -0
- package/templates/docker/src/lib/errors.ts +154 -0
- package/templates/docker/src/lib/logger.ts +98 -0
- package/templates/docker/src/lib/plugins/__tests__/hooks-integration.test.ts +202 -0
- package/templates/docker/src/lib/plugins/__tests__/hooks.test.ts +529 -0
- package/templates/docker/src/lib/plugins/__tests__/migrate.test.ts +521 -0
- package/templates/docker/src/lib/plugins/__tests__/registry.test.ts +346 -0
- package/templates/docker/src/lib/plugins/__tests__/tools.test.ts +49 -0
- package/templates/docker/src/lib/plugins/__tests__/wiring.test.ts +585 -0
- package/templates/docker/src/lib/plugins/hooks.ts +162 -0
- package/templates/docker/src/lib/plugins/index.ts +9 -0
- package/templates/docker/src/lib/plugins/migrate.ts +309 -0
- package/templates/docker/src/lib/plugins/registry.ts +231 -0
- package/templates/docker/src/lib/plugins/tools.ts +39 -0
- package/templates/docker/src/lib/plugins/wiring.ts +291 -0
- package/templates/docker/src/lib/providers.ts +102 -0
- package/templates/docker/src/lib/rls.ts +321 -0
- package/templates/docker/src/lib/scheduled-task-types.ts +132 -0
- package/templates/docker/src/lib/scheduled-tasks.ts +475 -0
- package/templates/docker/src/lib/scheduler/__tests__/delivery.test.ts +192 -0
- package/templates/docker/src/lib/scheduler/__tests__/engine.test.ts +248 -0
- package/templates/docker/src/lib/scheduler/__tests__/format-email.test.ts +96 -0
- package/templates/docker/src/lib/scheduler/__tests__/format-slack.test.ts +78 -0
- package/templates/docker/src/lib/scheduler/__tests__/format-webhook.test.ts +78 -0
- package/templates/docker/src/lib/scheduler/delivery.ts +248 -0
- package/templates/docker/src/lib/scheduler/engine.ts +317 -0
- package/templates/docker/src/lib/scheduler/executor.ts +73 -0
- package/templates/docker/src/lib/scheduler/format-email.ts +109 -0
- package/templates/docker/src/lib/scheduler/format-slack.ts +35 -0
- package/templates/docker/src/lib/scheduler/format-webhook.ts +37 -0
- package/templates/docker/src/lib/scheduler/index.ts +7 -0
- package/templates/docker/src/lib/security.ts +11 -0
- package/templates/docker/src/lib/semantic-index.ts +503 -0
- package/templates/docker/src/lib/semantic.ts +387 -0
- package/templates/docker/src/lib/sidecar-types.ts +16 -0
- package/templates/docker/src/lib/slack/__tests__/api.test.ts +160 -0
- package/templates/docker/src/lib/slack/__tests__/format.test.ts +237 -0
- package/templates/docker/src/lib/slack/__tests__/store.test.ts +188 -0
- package/templates/docker/src/lib/slack/__tests__/threads.test.ts +112 -0
- package/templates/docker/src/lib/slack/__tests__/verify.test.ts +111 -0
- package/templates/docker/src/lib/slack/api.ts +102 -0
- package/templates/docker/src/lib/slack/format.ts +209 -0
- package/templates/docker/src/lib/slack/store.ts +107 -0
- package/templates/docker/src/lib/slack/threads.ts +64 -0
- package/templates/docker/src/lib/slack/verify.ts +71 -0
- package/templates/docker/src/lib/startup.ts +730 -0
- package/templates/docker/src/lib/tools/__tests__/action-permissions.test.ts +594 -0
- package/templates/docker/src/lib/tools/__tests__/custom-validation.test.ts +238 -0
- package/templates/docker/src/lib/tools/__tests__/explore-backend.test.ts +267 -0
- package/templates/docker/src/lib/tools/__tests__/explore-nsjail.test.ts +492 -0
- package/templates/docker/src/lib/tools/__tests__/explore-plugin.test.ts +374 -0
- package/templates/docker/src/lib/tools/__tests__/explore-sdk-compat.test.ts +82 -0
- package/templates/docker/src/lib/tools/__tests__/explore-sidecar.test.ts +208 -0
- package/templates/docker/src/lib/tools/__tests__/registry-actions.test.ts +144 -0
- package/templates/docker/src/lib/tools/__tests__/registry.test.ts +235 -0
- package/templates/docker/src/lib/tools/__tests__/salesforce-tool.test.ts +154 -0
- package/templates/docker/src/lib/tools/__tests__/soql-validation.test.ts +303 -0
- package/templates/docker/src/lib/tools/__tests__/sql-audit.test.ts +225 -0
- package/templates/docker/src/lib/tools/__tests__/sql-connection-whitelist.test.ts +98 -0
- package/templates/docker/src/lib/tools/__tests__/sql-duckdb.test.ts +233 -0
- package/templates/docker/src/lib/tools/__tests__/sql-ratelimit.test.ts +225 -0
- package/templates/docker/src/lib/tools/__tests__/sql.test.ts +1012 -0
- package/templates/docker/src/lib/tools/actions/__tests__/audit.test.ts +211 -0
- package/templates/docker/src/lib/tools/actions/__tests__/email.test.ts +378 -0
- package/templates/docker/src/lib/tools/actions/__tests__/handler.test.ts +681 -0
- package/templates/docker/src/lib/tools/actions/__tests__/jira.test.ts +427 -0
- package/templates/docker/src/lib/tools/actions/audit.ts +47 -0
- package/templates/docker/src/lib/tools/actions/email.ts +191 -0
- package/templates/docker/src/lib/tools/actions/handler.ts +591 -0
- package/templates/docker/src/lib/tools/actions/index.ts +23 -0
- package/templates/docker/src/lib/tools/actions/jira.ts +220 -0
- package/templates/docker/src/lib/tools/explore-nsjail.ts +343 -0
- package/templates/docker/src/lib/tools/explore-sandbox.ts +264 -0
- package/templates/docker/src/lib/tools/explore-sidecar.ts +163 -0
- package/templates/docker/src/lib/tools/explore.ts +379 -0
- package/templates/docker/src/lib/tools/registry.ts +221 -0
- package/templates/docker/src/lib/tools/salesforce.ts +138 -0
- package/templates/docker/src/lib/tools/soql-validation.ts +172 -0
- package/templates/docker/src/lib/tools/sql.ts +680 -0
- package/templates/docker/src/lib/tracing.ts +40 -0
- package/templates/docker/src/lib/utils.ts +6 -0
- package/templates/docker/src/test-setup.ts +38 -0
- package/templates/docker/src/types/vercel-sandbox.d.ts +54 -0
- package/templates/docker/src/ui/components/actions/action-approval-card.tsx +295 -0
- package/templates/docker/src/ui/components/actions/action-status-badge.tsx +50 -0
- package/templates/docker/src/ui/components/admin/admin-layout.tsx +26 -0
- package/templates/docker/src/ui/components/admin/admin-sidebar.tsx +96 -0
- package/templates/docker/src/ui/components/admin/empty-state.tsx +24 -0
- package/templates/docker/src/ui/components/admin/entity-detail.tsx +233 -0
- package/templates/docker/src/ui/components/admin/entity-list.tsx +96 -0
- package/templates/docker/src/ui/components/admin/error-banner.tsx +22 -0
- package/templates/docker/src/ui/components/admin/feature-disabled.tsx +44 -0
- package/templates/docker/src/ui/components/admin/health-badge.tsx +30 -0
- package/templates/docker/src/ui/components/admin/loading-state.tsx +14 -0
- package/templates/docker/src/ui/components/admin/stat-card.tsx +32 -0
- package/templates/docker/src/ui/components/atlas-chat.tsx +370 -0
- package/templates/docker/src/ui/components/chart/chart-detection.ts +261 -0
- package/templates/docker/src/ui/components/chart/result-chart.tsx +375 -0
- package/templates/docker/src/ui/components/chat/api-key-bar.tsx +66 -0
- package/templates/docker/src/ui/components/chat/copy-button.tsx +25 -0
- package/templates/docker/src/ui/components/chat/data-table.tsx +102 -0
- package/templates/docker/src/ui/components/chat/error-banner.tsx +32 -0
- package/templates/docker/src/ui/components/chat/explore-card.tsx +41 -0
- package/templates/docker/src/ui/components/chat/loading-card.tsx +10 -0
- package/templates/docker/src/ui/components/chat/managed-auth-card.tsx +116 -0
- package/templates/docker/src/ui/components/chat/markdown.tsx +72 -0
- package/templates/docker/src/ui/components/chat/sql-block.tsx +30 -0
- package/templates/docker/src/ui/components/chat/sql-result-card.tsx +144 -0
- package/templates/docker/src/ui/components/chat/starter-prompts.ts +6 -0
- package/templates/docker/src/ui/components/chat/tool-part.tsx +40 -0
- package/templates/docker/src/ui/components/chat/typing-indicator.tsx +19 -0
- package/templates/docker/src/ui/components/conversations/conversation-item.tsx +120 -0
- package/templates/docker/src/ui/components/conversations/conversation-list.tsx +66 -0
- package/templates/docker/src/ui/components/conversations/conversation-sidebar.tsx +78 -0
- package/templates/docker/src/ui/components/conversations/delete-confirmation.tsx +27 -0
- package/templates/docker/src/ui/context.tsx +78 -0
- package/templates/docker/src/ui/hooks/use-admin-fetch.ts +104 -0
- package/templates/docker/src/ui/hooks/use-conversations.ts +184 -0
- package/templates/docker/src/ui/hooks/use-dark-mode.ts +17 -0
- package/templates/docker/src/ui/lib/action-types.ts +63 -0
- package/templates/docker/src/ui/lib/helpers.ts +104 -0
- package/templates/docker/src/ui/lib/types.ts +145 -0
- package/templates/docker/tsconfig.json +41 -0
- package/templates/docker/vercel.json +3 -0
- package/templates/nextjs-standalone/.env.example +68 -0
- package/templates/nextjs-standalone/bin/__tests__/benchmark.test.ts +598 -0
- package/templates/nextjs-standalone/bin/__tests__/duckdb-ingest.test.ts +171 -0
- package/templates/nextjs-standalone/bin/__tests__/eval.test.ts +434 -0
- package/templates/nextjs-standalone/bin/__tests__/matview-partition.test.ts +615 -0
- package/templates/nextjs-standalone/bin/__tests__/multi-source.test.ts +113 -0
- package/templates/nextjs-standalone/bin/__tests__/plugin-cli.test.ts +322 -0
- package/templates/nextjs-standalone/bin/__tests__/profiler-heuristics.test.ts +608 -0
- package/templates/nextjs-standalone/bin/__tests__/query.test.ts +240 -0
- package/templates/nextjs-standalone/bin/__tests__/schema-drift.test.ts +542 -0
- package/templates/nextjs-standalone/bin/__tests__/view-yaml-generation.test.ts +146 -0
- package/templates/nextjs-standalone/bin/atlas.ts +5044 -0
- package/templates/nextjs-standalone/bin/benchmark.ts +695 -0
- package/templates/nextjs-standalone/bin/enrich.ts +559 -0
- package/templates/nextjs-standalone/bin/eval.ts +770 -0
- package/templates/nextjs-standalone/bin/smoke.ts +438 -0
- package/templates/nextjs-standalone/data/.gitkeep +0 -0
- package/templates/nextjs-standalone/data/cybersec.sql +1961 -0
- package/templates/nextjs-standalone/data/demo-semantic/catalog.yml +40 -0
- package/templates/nextjs-standalone/data/demo-semantic/entities/accounts.yml +170 -0
- package/templates/nextjs-standalone/data/demo-semantic/entities/companies.yml +207 -0
- package/templates/nextjs-standalone/data/demo-semantic/entities/people.yml +145 -0
- package/templates/nextjs-standalone/data/demo-semantic/glossary.yml +22 -0
- package/templates/nextjs-standalone/data/demo-semantic/metrics/accounts.yml +38 -0
- package/templates/nextjs-standalone/data/demo-semantic/metrics/companies.yml +89 -0
- package/templates/nextjs-standalone/data/demo.sql +373 -0
- package/templates/nextjs-standalone/data/ecommerce.sql +1690 -0
- package/templates/nextjs-standalone/data/init-demo-db.sql +8 -0
- package/templates/nextjs-standalone/docs/deploy.md +390 -0
- package/templates/nextjs-standalone/eslint.config.mjs +18 -0
- package/templates/nextjs-standalone/gitignore +5 -0
- package/templates/nextjs-standalone/next.config.ts +10 -0
- package/templates/nextjs-standalone/package.json +63 -0
- package/templates/nextjs-standalone/postcss.config.mjs +8 -0
- package/templates/nextjs-standalone/semantic/catalog.yml +5 -0
- package/templates/nextjs-standalone/semantic/entities/.gitkeep +0 -0
- package/templates/nextjs-standalone/semantic/glossary.yml +6 -0
- package/templates/nextjs-standalone/semantic/metrics/.gitkeep +0 -0
- package/templates/nextjs-standalone/src/api/__tests__/actions.test.ts +683 -0
- package/templates/nextjs-standalone/src/api/__tests__/admin.test.ts +820 -0
- package/templates/nextjs-standalone/src/api/__tests__/auth.test.ts +165 -0
- package/templates/nextjs-standalone/src/api/__tests__/chat.test.ts +376 -0
- package/templates/nextjs-standalone/src/api/__tests__/conversations.test.ts +555 -0
- package/templates/nextjs-standalone/src/api/__tests__/cors.test.ts +135 -0
- package/templates/nextjs-standalone/src/api/__tests__/health-plugin.test.ts +169 -0
- package/templates/nextjs-standalone/src/api/__tests__/health.test.ts +261 -0
- package/templates/nextjs-standalone/src/api/__tests__/query.test.ts +891 -0
- package/templates/nextjs-standalone/src/api/__tests__/scheduled-tasks.test.ts +601 -0
- package/templates/nextjs-standalone/src/api/__tests__/slack.test.ts +847 -0
- package/templates/nextjs-standalone/src/api/index.ts +117 -0
- package/templates/nextjs-standalone/src/api/routes/actions.ts +274 -0
- package/templates/nextjs-standalone/src/api/routes/admin.ts +757 -0
- package/templates/nextjs-standalone/src/api/routes/auth.ts +48 -0
- package/templates/nextjs-standalone/src/api/routes/chat.ts +465 -0
- package/templates/nextjs-standalone/src/api/routes/conversations.ts +266 -0
- package/templates/nextjs-standalone/src/api/routes/health.ts +287 -0
- package/templates/nextjs-standalone/src/api/routes/openapi.ts +390 -0
- package/templates/nextjs-standalone/src/api/routes/query.ts +318 -0
- package/templates/nextjs-standalone/src/api/routes/scheduled-tasks.ts +467 -0
- package/templates/nextjs-standalone/src/api/routes/slack.ts +611 -0
- package/templates/nextjs-standalone/src/api/server.ts +226 -0
- package/templates/nextjs-standalone/src/app/api/[...route]/route.ts +33 -0
- package/templates/nextjs-standalone/src/app/error.tsx +24 -0
- package/templates/nextjs-standalone/src/app/global-error.tsx +68 -0
- package/templates/nextjs-standalone/src/app/globals.css +126 -0
- package/templates/nextjs-standalone/src/app/layout.tsx +19 -0
- package/templates/nextjs-standalone/src/app/page.tsx +14 -0
- package/templates/nextjs-standalone/src/lib/__tests__/agent-cache.test.ts +437 -0
- package/templates/nextjs-standalone/src/lib/__tests__/agent-dialect.test.ts +114 -0
- package/templates/nextjs-standalone/src/lib/__tests__/agent-health-annotations.test.ts +164 -0
- package/templates/nextjs-standalone/src/lib/__tests__/agent-integration.test.ts +514 -0
- package/templates/nextjs-standalone/src/lib/__tests__/config-actions.test.ts +166 -0
- package/templates/nextjs-standalone/src/lib/__tests__/config.test.ts +1063 -0
- package/templates/nextjs-standalone/src/lib/__tests__/conversations.test.ts +589 -0
- package/templates/nextjs-standalone/src/lib/__tests__/errors.test.ts +256 -0
- package/templates/nextjs-standalone/src/lib/__tests__/logger.test.ts +200 -0
- package/templates/nextjs-standalone/src/lib/__tests__/providers.test.ts +99 -0
- package/templates/nextjs-standalone/src/lib/__tests__/rls.test.ts +435 -0
- package/templates/nextjs-standalone/src/lib/__tests__/scheduled-task-types.test.ts +124 -0
- package/templates/nextjs-standalone/src/lib/__tests__/scheduled-tasks.test.ts +550 -0
- package/templates/nextjs-standalone/src/lib/__tests__/semantic-index.test.ts +547 -0
- package/templates/nextjs-standalone/src/lib/__tests__/semantic-multisource.test.ts +544 -0
- package/templates/nextjs-standalone/src/lib/__tests__/semantic.test.ts +363 -0
- package/templates/nextjs-standalone/src/lib/__tests__/startup-actions.test.ts +452 -0
- package/templates/nextjs-standalone/src/lib/__tests__/startup.test.ts +465 -0
- package/templates/nextjs-standalone/src/lib/__tests__/tracing.test.ts +28 -0
- package/templates/nextjs-standalone/src/lib/action-types.ts +95 -0
- package/templates/nextjs-standalone/src/lib/agent-query.ts +178 -0
- package/templates/nextjs-standalone/src/lib/agent.ts +505 -0
- package/templates/nextjs-standalone/src/lib/api-url.ts +3 -0
- package/templates/nextjs-standalone/src/lib/auth/__tests__/audit.test.ts +418 -0
- package/templates/nextjs-standalone/src/lib/auth/__tests__/byot-integration.test.ts +222 -0
- package/templates/nextjs-standalone/src/lib/auth/__tests__/byot.test.ts +366 -0
- package/templates/nextjs-standalone/src/lib/auth/__tests__/detect.test.ts +190 -0
- package/templates/nextjs-standalone/src/lib/auth/__tests__/managed.test.ts +173 -0
- package/templates/nextjs-standalone/src/lib/auth/__tests__/middleware.test.ts +456 -0
- package/templates/nextjs-standalone/src/lib/auth/__tests__/migrate.test.ts +201 -0
- package/templates/nextjs-standalone/src/lib/auth/__tests__/permissions.test.ts +225 -0
- package/templates/nextjs-standalone/src/lib/auth/__tests__/server.test.ts +34 -0
- package/templates/nextjs-standalone/src/lib/auth/__tests__/simple-key.test.ts +176 -0
- package/templates/nextjs-standalone/src/lib/auth/__tests__/types.test.ts +44 -0
- package/templates/nextjs-standalone/src/lib/auth/audit.ts +89 -0
- package/templates/nextjs-standalone/src/lib/auth/byot.ts +158 -0
- package/templates/nextjs-standalone/src/lib/auth/client.ts +23 -0
- package/templates/nextjs-standalone/src/lib/auth/detect.ts +83 -0
- package/templates/nextjs-standalone/src/lib/auth/managed.ts +73 -0
- package/templates/nextjs-standalone/src/lib/auth/middleware.ts +208 -0
- package/templates/nextjs-standalone/src/lib/auth/migrate.ts +111 -0
- package/templates/nextjs-standalone/src/lib/auth/permissions.ts +156 -0
- package/templates/nextjs-standalone/src/lib/auth/server.ts +142 -0
- package/templates/nextjs-standalone/src/lib/auth/simple-key.ts +92 -0
- package/templates/nextjs-standalone/src/lib/auth/types.ts +49 -0
- package/templates/nextjs-standalone/src/lib/config.ts +704 -0
- package/templates/nextjs-standalone/src/lib/conversation-types.ts +29 -0
- package/templates/nextjs-standalone/src/lib/conversations.ts +270 -0
- package/templates/nextjs-standalone/src/lib/db/__tests__/connection.test.ts +69 -0
- package/templates/nextjs-standalone/src/lib/db/__tests__/duckdb.test.ts +141 -0
- package/templates/nextjs-standalone/src/lib/db/__tests__/internal.test.ts +387 -0
- package/templates/nextjs-standalone/src/lib/db/__tests__/registry-health.test.ts +207 -0
- package/templates/nextjs-standalone/src/lib/db/__tests__/registry-pool-limits.test.ts +156 -0
- package/templates/nextjs-standalone/src/lib/db/__tests__/registry.test.ts +595 -0
- package/templates/nextjs-standalone/src/lib/db/__tests__/salesforce.test.ts +339 -0
- package/templates/nextjs-standalone/src/lib/db/__tests__/snowflake.test.ts +217 -0
- package/templates/nextjs-standalone/src/lib/db/__tests__/source-rate-limit.test.ts +130 -0
- package/templates/nextjs-standalone/src/lib/db/connection.ts +753 -0
- package/templates/nextjs-standalone/src/lib/db/duckdb.ts +122 -0
- package/templates/nextjs-standalone/src/lib/db/internal.ts +273 -0
- package/templates/nextjs-standalone/src/lib/db/salesforce.ts +342 -0
- package/templates/nextjs-standalone/src/lib/db/source-rate-limit.ts +191 -0
- package/templates/nextjs-standalone/src/lib/errors.ts +154 -0
- package/templates/nextjs-standalone/src/lib/logger.ts +98 -0
- package/templates/nextjs-standalone/src/lib/plugins/__tests__/hooks-integration.test.ts +202 -0
- package/templates/nextjs-standalone/src/lib/plugins/__tests__/hooks.test.ts +529 -0
- package/templates/nextjs-standalone/src/lib/plugins/__tests__/migrate.test.ts +521 -0
- package/templates/nextjs-standalone/src/lib/plugins/__tests__/registry.test.ts +346 -0
- package/templates/nextjs-standalone/src/lib/plugins/__tests__/tools.test.ts +49 -0
- package/templates/nextjs-standalone/src/lib/plugins/__tests__/wiring.test.ts +585 -0
- package/templates/nextjs-standalone/src/lib/plugins/hooks.ts +162 -0
- package/templates/nextjs-standalone/src/lib/plugins/index.ts +9 -0
- package/templates/nextjs-standalone/src/lib/plugins/migrate.ts +309 -0
- package/templates/nextjs-standalone/src/lib/plugins/registry.ts +231 -0
- package/templates/nextjs-standalone/src/lib/plugins/tools.ts +39 -0
- package/templates/nextjs-standalone/src/lib/plugins/wiring.ts +291 -0
- package/templates/nextjs-standalone/src/lib/providers.ts +102 -0
- package/templates/nextjs-standalone/src/lib/rls.ts +321 -0
- package/templates/nextjs-standalone/src/lib/scheduled-task-types.ts +132 -0
- package/templates/nextjs-standalone/src/lib/scheduled-tasks.ts +475 -0
- package/templates/nextjs-standalone/src/lib/scheduler/__tests__/delivery.test.ts +192 -0
- package/templates/nextjs-standalone/src/lib/scheduler/__tests__/engine.test.ts +248 -0
- package/templates/nextjs-standalone/src/lib/scheduler/__tests__/format-email.test.ts +96 -0
- package/templates/nextjs-standalone/src/lib/scheduler/__tests__/format-slack.test.ts +78 -0
- package/templates/nextjs-standalone/src/lib/scheduler/__tests__/format-webhook.test.ts +78 -0
- package/templates/nextjs-standalone/src/lib/scheduler/delivery.ts +248 -0
- package/templates/nextjs-standalone/src/lib/scheduler/engine.ts +317 -0
- package/templates/nextjs-standalone/src/lib/scheduler/executor.ts +73 -0
- package/templates/nextjs-standalone/src/lib/scheduler/format-email.ts +109 -0
- package/templates/nextjs-standalone/src/lib/scheduler/format-slack.ts +35 -0
- package/templates/nextjs-standalone/src/lib/scheduler/format-webhook.ts +37 -0
- package/templates/nextjs-standalone/src/lib/scheduler/index.ts +7 -0
- package/templates/nextjs-standalone/src/lib/security.ts +11 -0
- package/templates/nextjs-standalone/src/lib/semantic-index.ts +503 -0
- package/templates/nextjs-standalone/src/lib/semantic.ts +387 -0
- package/templates/nextjs-standalone/src/lib/sidecar-types.ts +16 -0
- package/templates/nextjs-standalone/src/lib/slack/__tests__/api.test.ts +160 -0
- package/templates/nextjs-standalone/src/lib/slack/__tests__/format.test.ts +237 -0
- package/templates/nextjs-standalone/src/lib/slack/__tests__/store.test.ts +188 -0
- package/templates/nextjs-standalone/src/lib/slack/__tests__/threads.test.ts +112 -0
- package/templates/nextjs-standalone/src/lib/slack/__tests__/verify.test.ts +111 -0
- package/templates/nextjs-standalone/src/lib/slack/api.ts +102 -0
- package/templates/nextjs-standalone/src/lib/slack/format.ts +209 -0
- package/templates/nextjs-standalone/src/lib/slack/store.ts +107 -0
- package/templates/nextjs-standalone/src/lib/slack/threads.ts +64 -0
- package/templates/nextjs-standalone/src/lib/slack/verify.ts +71 -0
- package/templates/nextjs-standalone/src/lib/startup.ts +730 -0
- package/templates/nextjs-standalone/src/lib/tools/__tests__/action-permissions.test.ts +594 -0
- package/templates/nextjs-standalone/src/lib/tools/__tests__/custom-validation.test.ts +238 -0
- package/templates/nextjs-standalone/src/lib/tools/__tests__/explore-backend.test.ts +267 -0
- package/templates/nextjs-standalone/src/lib/tools/__tests__/explore-nsjail.test.ts +492 -0
- package/templates/nextjs-standalone/src/lib/tools/__tests__/explore-plugin.test.ts +374 -0
- package/templates/nextjs-standalone/src/lib/tools/__tests__/explore-sdk-compat.test.ts +82 -0
- package/templates/nextjs-standalone/src/lib/tools/__tests__/explore-sidecar.test.ts +208 -0
- package/templates/nextjs-standalone/src/lib/tools/__tests__/registry-actions.test.ts +144 -0
- package/templates/nextjs-standalone/src/lib/tools/__tests__/registry.test.ts +235 -0
- package/templates/nextjs-standalone/src/lib/tools/__tests__/salesforce-tool.test.ts +154 -0
- package/templates/nextjs-standalone/src/lib/tools/__tests__/soql-validation.test.ts +303 -0
- package/templates/nextjs-standalone/src/lib/tools/__tests__/sql-audit.test.ts +225 -0
- package/templates/nextjs-standalone/src/lib/tools/__tests__/sql-connection-whitelist.test.ts +98 -0
- package/templates/nextjs-standalone/src/lib/tools/__tests__/sql-duckdb.test.ts +233 -0
- package/templates/nextjs-standalone/src/lib/tools/__tests__/sql-ratelimit.test.ts +225 -0
- package/templates/nextjs-standalone/src/lib/tools/__tests__/sql.test.ts +1012 -0
- package/templates/nextjs-standalone/src/lib/tools/actions/__tests__/audit.test.ts +211 -0
- package/templates/nextjs-standalone/src/lib/tools/actions/__tests__/email.test.ts +378 -0
- package/templates/nextjs-standalone/src/lib/tools/actions/__tests__/handler.test.ts +681 -0
- package/templates/nextjs-standalone/src/lib/tools/actions/__tests__/jira.test.ts +427 -0
- package/templates/nextjs-standalone/src/lib/tools/actions/audit.ts +47 -0
- package/templates/nextjs-standalone/src/lib/tools/actions/email.ts +191 -0
- package/templates/nextjs-standalone/src/lib/tools/actions/handler.ts +591 -0
- package/templates/nextjs-standalone/src/lib/tools/actions/index.ts +23 -0
- package/templates/nextjs-standalone/src/lib/tools/actions/jira.ts +220 -0
- package/templates/nextjs-standalone/src/lib/tools/explore-nsjail.ts +343 -0
- package/templates/nextjs-standalone/src/lib/tools/explore-sandbox.ts +264 -0
- package/templates/nextjs-standalone/src/lib/tools/explore-sidecar.ts +163 -0
- package/templates/nextjs-standalone/src/lib/tools/explore.ts +379 -0
- package/templates/nextjs-standalone/src/lib/tools/registry.ts +221 -0
- package/templates/nextjs-standalone/src/lib/tools/salesforce.ts +138 -0
- package/templates/nextjs-standalone/src/lib/tools/soql-validation.ts +172 -0
- package/templates/nextjs-standalone/src/lib/tools/sql.ts +680 -0
- package/templates/nextjs-standalone/src/lib/tracing.ts +40 -0
- package/templates/nextjs-standalone/src/lib/utils.ts +6 -0
- package/templates/nextjs-standalone/src/test-setup.ts +38 -0
- package/templates/nextjs-standalone/src/ui/components/actions/action-approval-card.tsx +295 -0
- package/templates/nextjs-standalone/src/ui/components/actions/action-status-badge.tsx +50 -0
- package/templates/nextjs-standalone/src/ui/components/admin/admin-layout.tsx +26 -0
- package/templates/nextjs-standalone/src/ui/components/admin/admin-sidebar.tsx +96 -0
- package/templates/nextjs-standalone/src/ui/components/admin/empty-state.tsx +24 -0
- package/templates/nextjs-standalone/src/ui/components/admin/entity-detail.tsx +233 -0
- package/templates/nextjs-standalone/src/ui/components/admin/entity-list.tsx +96 -0
- package/templates/nextjs-standalone/src/ui/components/admin/error-banner.tsx +22 -0
- package/templates/nextjs-standalone/src/ui/components/admin/feature-disabled.tsx +44 -0
- package/templates/nextjs-standalone/src/ui/components/admin/health-badge.tsx +30 -0
- package/templates/nextjs-standalone/src/ui/components/admin/loading-state.tsx +14 -0
- package/templates/nextjs-standalone/src/ui/components/admin/stat-card.tsx +32 -0
- package/templates/nextjs-standalone/src/ui/components/atlas-chat.tsx +370 -0
- package/templates/nextjs-standalone/src/ui/components/chart/chart-detection.ts +261 -0
- package/templates/nextjs-standalone/src/ui/components/chart/result-chart.tsx +375 -0
- package/templates/nextjs-standalone/src/ui/components/chat/api-key-bar.tsx +66 -0
- package/templates/nextjs-standalone/src/ui/components/chat/copy-button.tsx +25 -0
- package/templates/nextjs-standalone/src/ui/components/chat/data-table.tsx +102 -0
- package/templates/nextjs-standalone/src/ui/components/chat/error-banner.tsx +32 -0
- package/templates/nextjs-standalone/src/ui/components/chat/explore-card.tsx +41 -0
- package/templates/nextjs-standalone/src/ui/components/chat/loading-card.tsx +10 -0
- package/templates/nextjs-standalone/src/ui/components/chat/managed-auth-card.tsx +116 -0
- package/templates/nextjs-standalone/src/ui/components/chat/markdown.tsx +72 -0
- package/templates/nextjs-standalone/src/ui/components/chat/sql-block.tsx +30 -0
- package/templates/nextjs-standalone/src/ui/components/chat/sql-result-card.tsx +144 -0
- package/templates/nextjs-standalone/src/ui/components/chat/starter-prompts.ts +6 -0
- package/templates/nextjs-standalone/src/ui/components/chat/tool-part.tsx +40 -0
- package/templates/nextjs-standalone/src/ui/components/chat/typing-indicator.tsx +19 -0
- package/templates/nextjs-standalone/src/ui/components/conversations/conversation-item.tsx +120 -0
- package/templates/nextjs-standalone/src/ui/components/conversations/conversation-list.tsx +66 -0
- package/templates/nextjs-standalone/src/ui/components/conversations/conversation-sidebar.tsx +78 -0
- package/templates/nextjs-standalone/src/ui/components/conversations/delete-confirmation.tsx +27 -0
- package/templates/nextjs-standalone/src/ui/context.tsx +78 -0
- package/templates/nextjs-standalone/src/ui/hooks/use-admin-fetch.ts +104 -0
- package/templates/nextjs-standalone/src/ui/hooks/use-conversations.ts +184 -0
- package/templates/nextjs-standalone/src/ui/hooks/use-dark-mode.ts +17 -0
- package/templates/nextjs-standalone/src/ui/lib/action-types.ts +63 -0
- package/templates/nextjs-standalone/src/ui/lib/helpers.ts +104 -0
- package/templates/nextjs-standalone/src/ui/lib/types.ts +145 -0
- package/templates/nextjs-standalone/tsconfig.json +32 -0
- package/templates/nextjs-standalone/vercel.json +4 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
version: '1.0'
|
|
2
|
+
entities:
|
|
3
|
+
- name: Accounts
|
|
4
|
+
file: entities/accounts.yml
|
|
5
|
+
grain: one row per account record
|
|
6
|
+
description: accounts (80 rows, 7 columns)
|
|
7
|
+
use_for:
|
|
8
|
+
- Segmentation by plan, status
|
|
9
|
+
- Aggregation on monthly_value
|
|
10
|
+
- Cross-entity analysis via companies
|
|
11
|
+
common_questions:
|
|
12
|
+
- How many accounts by plan?
|
|
13
|
+
- How many accounts by status?
|
|
14
|
+
- What is the average monthly_value across accounts?
|
|
15
|
+
- How are accounts distributed across companies?
|
|
16
|
+
- name: Companies
|
|
17
|
+
file: entities/companies.yml
|
|
18
|
+
grain: one row per company record
|
|
19
|
+
description: companies (50 rows, 8 columns)
|
|
20
|
+
use_for:
|
|
21
|
+
- Aggregation on employee_count, founded_year, revenue, valuation
|
|
22
|
+
common_questions:
|
|
23
|
+
- What is the average employee_count across companies?
|
|
24
|
+
- name: People
|
|
25
|
+
file: entities/people.yml
|
|
26
|
+
grain: one row per person record
|
|
27
|
+
description: people (198 rows, 8 columns)
|
|
28
|
+
use_for:
|
|
29
|
+
- Segmentation by department, seniority
|
|
30
|
+
- Cross-entity analysis via companies
|
|
31
|
+
common_questions:
|
|
32
|
+
- How many people by department?
|
|
33
|
+
- How many people by seniority?
|
|
34
|
+
- How are people distributed across companies?
|
|
35
|
+
glossary: glossary.yml
|
|
36
|
+
metrics:
|
|
37
|
+
- file: metrics/accounts.yml
|
|
38
|
+
description: Auto-generated metrics for accounts
|
|
39
|
+
- file: metrics/companies.yml
|
|
40
|
+
description: Auto-generated metrics for companies
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
name: Accounts
|
|
2
|
+
type: fact_table
|
|
3
|
+
table: accounts
|
|
4
|
+
grain: one row per account record
|
|
5
|
+
description: Auto-profiled schema for accounts (80 rows). Contains 7 columns, linked to companies.
|
|
6
|
+
dimensions:
|
|
7
|
+
- name: id
|
|
8
|
+
sql: id
|
|
9
|
+
type: number
|
|
10
|
+
description: Primary key
|
|
11
|
+
primary_key: true
|
|
12
|
+
unique_count: 80
|
|
13
|
+
sample_values:
|
|
14
|
+
- '1'
|
|
15
|
+
- '2'
|
|
16
|
+
- '3'
|
|
17
|
+
- '4'
|
|
18
|
+
- '5'
|
|
19
|
+
- '6'
|
|
20
|
+
- '7'
|
|
21
|
+
- '8'
|
|
22
|
+
- name: company_id
|
|
23
|
+
sql: company_id
|
|
24
|
+
type: number
|
|
25
|
+
description: Foreign key to companies
|
|
26
|
+
unique_count: 50
|
|
27
|
+
sample_values:
|
|
28
|
+
- '1'
|
|
29
|
+
- '2'
|
|
30
|
+
- '3'
|
|
31
|
+
- '4'
|
|
32
|
+
- '5'
|
|
33
|
+
- '6'
|
|
34
|
+
- '7'
|
|
35
|
+
- '8'
|
|
36
|
+
- name: plan
|
|
37
|
+
sql: plan
|
|
38
|
+
type: string
|
|
39
|
+
unique_count: 4
|
|
40
|
+
sample_values:
|
|
41
|
+
- Enterprise
|
|
42
|
+
- Free
|
|
43
|
+
- Pro
|
|
44
|
+
- Starter
|
|
45
|
+
- name: status
|
|
46
|
+
sql: status
|
|
47
|
+
type: string
|
|
48
|
+
unique_count: 4
|
|
49
|
+
sample_values:
|
|
50
|
+
- Active
|
|
51
|
+
- Churned
|
|
52
|
+
- Inactive
|
|
53
|
+
- Suspended
|
|
54
|
+
- name: monthly_value
|
|
55
|
+
sql: monthly_value
|
|
56
|
+
type: number
|
|
57
|
+
unique_count: 41
|
|
58
|
+
sample_values:
|
|
59
|
+
- '0'
|
|
60
|
+
- '49'
|
|
61
|
+
- '59'
|
|
62
|
+
- '69'
|
|
63
|
+
- '79'
|
|
64
|
+
- '89'
|
|
65
|
+
- '299'
|
|
66
|
+
- '350'
|
|
67
|
+
- name: contract_start
|
|
68
|
+
sql: contract_start
|
|
69
|
+
type: date
|
|
70
|
+
unique_count: 49
|
|
71
|
+
sample_values:
|
|
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)
|
|
80
|
+
- name: contract_end
|
|
81
|
+
sql: contract_end
|
|
82
|
+
type: date
|
|
83
|
+
unique_count: 10
|
|
84
|
+
null_count: 70
|
|
85
|
+
sample_values:
|
|
86
|
+
- Fri Jan 01 2021 00:00:00 GMT-0500 (Eastern Standard Time)
|
|
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)
|
|
94
|
+
- name: monthly_value_bucket
|
|
95
|
+
sql: |-
|
|
96
|
+
CASE
|
|
97
|
+
WHEN monthly_value < (SELECT PERCENTILE_CONT(0.33) WITHIN GROUP (ORDER BY monthly_value) FROM accounts) THEN 'Low'
|
|
98
|
+
WHEN monthly_value < (SELECT PERCENTILE_CONT(0.66) WITHIN GROUP (ORDER BY monthly_value) FROM accounts) THEN 'Medium'
|
|
99
|
+
ELSE 'High'
|
|
100
|
+
END
|
|
101
|
+
type: string
|
|
102
|
+
description: monthly value bucketed into Low/Medium/High terciles
|
|
103
|
+
virtual: true
|
|
104
|
+
sample_values:
|
|
105
|
+
- Low
|
|
106
|
+
- Medium
|
|
107
|
+
- High
|
|
108
|
+
- name: contract_start_year
|
|
109
|
+
sql: EXTRACT(YEAR FROM contract_start)
|
|
110
|
+
type: number
|
|
111
|
+
description: Year extracted from contract_start
|
|
112
|
+
virtual: true
|
|
113
|
+
- name: contract_start_month
|
|
114
|
+
sql: TO_CHAR(contract_start, 'YYYY-MM')
|
|
115
|
+
type: string
|
|
116
|
+
description: Year-month extracted from contract_start
|
|
117
|
+
virtual: true
|
|
118
|
+
- name: contract_end_year
|
|
119
|
+
sql: EXTRACT(YEAR FROM contract_end)
|
|
120
|
+
type: number
|
|
121
|
+
description: Year extracted from contract_end
|
|
122
|
+
virtual: true
|
|
123
|
+
- name: contract_end_month
|
|
124
|
+
sql: TO_CHAR(contract_end, 'YYYY-MM')
|
|
125
|
+
type: string
|
|
126
|
+
description: Year-month extracted from contract_end
|
|
127
|
+
virtual: true
|
|
128
|
+
measures:
|
|
129
|
+
- name: account_count
|
|
130
|
+
sql: id
|
|
131
|
+
type: count_distinct
|
|
132
|
+
- name: total_monthly_value
|
|
133
|
+
sql: monthly_value
|
|
134
|
+
type: sum
|
|
135
|
+
description: Sum of monthly value
|
|
136
|
+
- name: avg_monthly_value
|
|
137
|
+
sql: monthly_value
|
|
138
|
+
type: avg
|
|
139
|
+
description: Average monthly value
|
|
140
|
+
joins:
|
|
141
|
+
- target_entity: Companies
|
|
142
|
+
relationship: many_to_one
|
|
143
|
+
join_columns:
|
|
144
|
+
from: company_id
|
|
145
|
+
to: id
|
|
146
|
+
description: Each account belongs to one company
|
|
147
|
+
use_cases:
|
|
148
|
+
- Use for segmentation analysis by plan, status
|
|
149
|
+
- Use for aggregation and trends on monthly_value
|
|
150
|
+
- Use for time-series analysis using contract_start, contract_end
|
|
151
|
+
- Join with companies for cross-entity analysis
|
|
152
|
+
query_patterns:
|
|
153
|
+
- description: Accounts by plan
|
|
154
|
+
sql: |-
|
|
155
|
+
SELECT plan, COUNT(*) as count
|
|
156
|
+
FROM accounts
|
|
157
|
+
GROUP BY plan
|
|
158
|
+
ORDER BY count DESC
|
|
159
|
+
- description: Accounts by status
|
|
160
|
+
sql: |-
|
|
161
|
+
SELECT status, COUNT(*) as count
|
|
162
|
+
FROM accounts
|
|
163
|
+
GROUP BY status
|
|
164
|
+
ORDER BY count DESC
|
|
165
|
+
- description: Total monthly_value by plan
|
|
166
|
+
sql: |-
|
|
167
|
+
SELECT plan, SUM(monthly_value) as total_monthly_value, COUNT(*) as count
|
|
168
|
+
FROM accounts
|
|
169
|
+
GROUP BY plan
|
|
170
|
+
ORDER BY total_monthly_value DESC
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
name: Companies
|
|
2
|
+
type: fact_table
|
|
3
|
+
table: companies
|
|
4
|
+
grain: one row per company record
|
|
5
|
+
description: Auto-profiled schema for companies (50 rows). Contains 8 columns.
|
|
6
|
+
dimensions:
|
|
7
|
+
- name: id
|
|
8
|
+
sql: id
|
|
9
|
+
type: number
|
|
10
|
+
description: Primary key
|
|
11
|
+
primary_key: true
|
|
12
|
+
unique_count: 50
|
|
13
|
+
sample_values:
|
|
14
|
+
- '1'
|
|
15
|
+
- '2'
|
|
16
|
+
- '3'
|
|
17
|
+
- '4'
|
|
18
|
+
- '5'
|
|
19
|
+
- '6'
|
|
20
|
+
- '7'
|
|
21
|
+
- '8'
|
|
22
|
+
- name: name
|
|
23
|
+
sql: name
|
|
24
|
+
type: string
|
|
25
|
+
unique_count: 50
|
|
26
|
+
sample_values:
|
|
27
|
+
- Acme Corp
|
|
28
|
+
- AdTech Global
|
|
29
|
+
- AutoForge
|
|
30
|
+
- BioGenix
|
|
31
|
+
- BrightMinds
|
|
32
|
+
- CartFlow
|
|
33
|
+
- CastMedia
|
|
34
|
+
- CleanJoule
|
|
35
|
+
- name: industry
|
|
36
|
+
sql: industry
|
|
37
|
+
type: string
|
|
38
|
+
unique_count: 8
|
|
39
|
+
sample_values:
|
|
40
|
+
- Education
|
|
41
|
+
- Energy
|
|
42
|
+
- Finance
|
|
43
|
+
- Healthcare
|
|
44
|
+
- Manufacturing
|
|
45
|
+
- Media
|
|
46
|
+
- Retail
|
|
47
|
+
- Technology
|
|
48
|
+
- name: employee_count
|
|
49
|
+
sql: employee_count
|
|
50
|
+
type: number
|
|
51
|
+
unique_count: 46
|
|
52
|
+
sample_values:
|
|
53
|
+
- '50'
|
|
54
|
+
- '55'
|
|
55
|
+
- '60'
|
|
56
|
+
- '65'
|
|
57
|
+
- '70'
|
|
58
|
+
- '75'
|
|
59
|
+
- '80'
|
|
60
|
+
- '85'
|
|
61
|
+
- name: founded_year
|
|
62
|
+
sql: founded_year
|
|
63
|
+
type: number
|
|
64
|
+
unique_count: 19
|
|
65
|
+
sample_values:
|
|
66
|
+
- '2004'
|
|
67
|
+
- '2005'
|
|
68
|
+
- '2006'
|
|
69
|
+
- '2007'
|
|
70
|
+
- '2008'
|
|
71
|
+
- '2009'
|
|
72
|
+
- '2010'
|
|
73
|
+
- '2011'
|
|
74
|
+
- name: country
|
|
75
|
+
sql: country
|
|
76
|
+
type: string
|
|
77
|
+
unique_count: 10
|
|
78
|
+
sample_values:
|
|
79
|
+
- AU
|
|
80
|
+
- BR
|
|
81
|
+
- CA
|
|
82
|
+
- DE
|
|
83
|
+
- FR
|
|
84
|
+
- IN
|
|
85
|
+
- JP
|
|
86
|
+
- SG
|
|
87
|
+
- name: revenue
|
|
88
|
+
sql: revenue
|
|
89
|
+
type: number
|
|
90
|
+
unique_count: 50
|
|
91
|
+
sample_values:
|
|
92
|
+
- '2000000'
|
|
93
|
+
- '2500000'
|
|
94
|
+
- '3500000'
|
|
95
|
+
- '4000000'
|
|
96
|
+
- '5000000'
|
|
97
|
+
- '6000000'
|
|
98
|
+
- '6500000'
|
|
99
|
+
- '7000000'
|
|
100
|
+
- name: valuation
|
|
101
|
+
sql: valuation
|
|
102
|
+
type: number
|
|
103
|
+
unique_count: 46
|
|
104
|
+
sample_values:
|
|
105
|
+
- '16000000'
|
|
106
|
+
- '20000000'
|
|
107
|
+
- '25000000'
|
|
108
|
+
- '28000000'
|
|
109
|
+
- '30000000'
|
|
110
|
+
- '32000000'
|
|
111
|
+
- '35000000'
|
|
112
|
+
- '40000000'
|
|
113
|
+
- name: employee_count_bucket
|
|
114
|
+
sql: |-
|
|
115
|
+
CASE
|
|
116
|
+
WHEN employee_count < (SELECT PERCENTILE_CONT(0.33) WITHIN GROUP (ORDER BY employee_count) FROM companies) THEN 'Low'
|
|
117
|
+
WHEN employee_count < (SELECT PERCENTILE_CONT(0.66) WITHIN GROUP (ORDER BY employee_count) FROM companies) THEN 'Medium'
|
|
118
|
+
ELSE 'High'
|
|
119
|
+
END
|
|
120
|
+
type: string
|
|
121
|
+
description: employee count bucketed into Low/Medium/High terciles
|
|
122
|
+
virtual: true
|
|
123
|
+
sample_values:
|
|
124
|
+
- Low
|
|
125
|
+
- Medium
|
|
126
|
+
- High
|
|
127
|
+
- name: founded_year_bucket
|
|
128
|
+
sql: |-
|
|
129
|
+
CASE
|
|
130
|
+
WHEN founded_year < (SELECT PERCENTILE_CONT(0.33) WITHIN GROUP (ORDER BY founded_year) FROM companies) THEN 'Low'
|
|
131
|
+
WHEN founded_year < (SELECT PERCENTILE_CONT(0.66) WITHIN GROUP (ORDER BY founded_year) FROM companies) THEN 'Medium'
|
|
132
|
+
ELSE 'High'
|
|
133
|
+
END
|
|
134
|
+
type: string
|
|
135
|
+
description: founded year bucketed into Low/Medium/High terciles
|
|
136
|
+
virtual: true
|
|
137
|
+
sample_values:
|
|
138
|
+
- Low
|
|
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
|
|
169
|
+
measures:
|
|
170
|
+
- name: company_count
|
|
171
|
+
sql: id
|
|
172
|
+
type: count_distinct
|
|
173
|
+
- name: total_employee_count
|
|
174
|
+
sql: employee_count
|
|
175
|
+
type: sum
|
|
176
|
+
description: Sum of employee count
|
|
177
|
+
- name: avg_employee_count
|
|
178
|
+
sql: employee_count
|
|
179
|
+
type: avg
|
|
180
|
+
description: Average employee count
|
|
181
|
+
- name: total_founded_year
|
|
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
|
|
189
|
+
- name: total_revenue
|
|
190
|
+
sql: revenue
|
|
191
|
+
type: sum
|
|
192
|
+
description: Sum of revenue
|
|
193
|
+
- name: avg_revenue
|
|
194
|
+
sql: revenue
|
|
195
|
+
type: avg
|
|
196
|
+
description: Average revenue
|
|
197
|
+
- name: total_valuation
|
|
198
|
+
sql: valuation
|
|
199
|
+
type: sum
|
|
200
|
+
description: Sum of valuation
|
|
201
|
+
- name: avg_valuation
|
|
202
|
+
sql: valuation
|
|
203
|
+
type: avg
|
|
204
|
+
description: Average valuation
|
|
205
|
+
use_cases:
|
|
206
|
+
- Use for aggregation and trends on employee_count, founded_year, revenue, valuation
|
|
207
|
+
- Avoid for row-level accounts/people queries — use those entities directly
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
name: People
|
|
2
|
+
type: fact_table
|
|
3
|
+
table: people
|
|
4
|
+
grain: one row per person record
|
|
5
|
+
description: Auto-profiled schema for people (198 rows). Contains 8 columns, linked to companies.
|
|
6
|
+
dimensions:
|
|
7
|
+
- name: id
|
|
8
|
+
sql: id
|
|
9
|
+
type: number
|
|
10
|
+
description: Primary key
|
|
11
|
+
primary_key: true
|
|
12
|
+
unique_count: 198
|
|
13
|
+
sample_values:
|
|
14
|
+
- '1'
|
|
15
|
+
- '2'
|
|
16
|
+
- '3'
|
|
17
|
+
- '4'
|
|
18
|
+
- '5'
|
|
19
|
+
- '6'
|
|
20
|
+
- '7'
|
|
21
|
+
- '8'
|
|
22
|
+
- name: name
|
|
23
|
+
sql: name
|
|
24
|
+
type: string
|
|
25
|
+
unique_count: 198
|
|
26
|
+
sample_values:
|
|
27
|
+
- Alex Brown
|
|
28
|
+
- Alex Chen
|
|
29
|
+
- Alex Garcia
|
|
30
|
+
- Alex Kim
|
|
31
|
+
- Alex Mueller
|
|
32
|
+
- Alex Patel
|
|
33
|
+
- Alex Silva
|
|
34
|
+
- Alex Smith
|
|
35
|
+
- name: email
|
|
36
|
+
sql: email
|
|
37
|
+
type: string
|
|
38
|
+
unique_count: 198
|
|
39
|
+
sample_values:
|
|
40
|
+
- alex.brown@company32.com
|
|
41
|
+
- alex.chen@company12.com
|
|
42
|
+
- alex.garcia@company42.com
|
|
43
|
+
- alex.kim@company32.com
|
|
44
|
+
- alex.mueller@company2.com
|
|
45
|
+
- alex.patel@company22.com
|
|
46
|
+
- alex.silva@company22.com
|
|
47
|
+
- alex.smith@company1.com
|
|
48
|
+
- name: company_id
|
|
49
|
+
sql: company_id
|
|
50
|
+
type: number
|
|
51
|
+
description: Foreign key to companies
|
|
52
|
+
unique_count: 50
|
|
53
|
+
sample_values:
|
|
54
|
+
- '1'
|
|
55
|
+
- '2'
|
|
56
|
+
- '3'
|
|
57
|
+
- '4'
|
|
58
|
+
- '5'
|
|
59
|
+
- '6'
|
|
60
|
+
- '7'
|
|
61
|
+
- '8'
|
|
62
|
+
- name: department
|
|
63
|
+
sql: department
|
|
64
|
+
type: string
|
|
65
|
+
unique_count: 6
|
|
66
|
+
sample_values:
|
|
67
|
+
- Engineering
|
|
68
|
+
- Finance
|
|
69
|
+
- Marketing
|
|
70
|
+
- Operations
|
|
71
|
+
- Product
|
|
72
|
+
- Sales
|
|
73
|
+
- name: seniority
|
|
74
|
+
sql: seniority
|
|
75
|
+
type: string
|
|
76
|
+
unique_count: 4
|
|
77
|
+
sample_values:
|
|
78
|
+
- Executive
|
|
79
|
+
- Junior
|
|
80
|
+
- Mid
|
|
81
|
+
- Senior
|
|
82
|
+
- name: title
|
|
83
|
+
sql: title
|
|
84
|
+
type: string
|
|
85
|
+
unique_count: 30
|
|
86
|
+
sample_values:
|
|
87
|
+
- Accountant
|
|
88
|
+
- Account Executive
|
|
89
|
+
- Backend Engineer
|
|
90
|
+
- Brand Manager
|
|
91
|
+
- CFO
|
|
92
|
+
- Content Strategist
|
|
93
|
+
- Controller
|
|
94
|
+
- Data Analyst
|
|
95
|
+
- name: start_date
|
|
96
|
+
sql: start_date
|
|
97
|
+
type: date
|
|
98
|
+
unique_count: 158
|
|
99
|
+
sample_values:
|
|
100
|
+
- Wed Jan 10 2018 00:00:00 GMT-0500 (Eastern Standard Time)
|
|
101
|
+
- Mon Jan 15 2018 00:00:00 GMT-0500 (Eastern Standard Time)
|
|
102
|
+
- Thu Feb 01 2018 00:00:00 GMT-0500 (Eastern Standard Time)
|
|
103
|
+
- Sat Mar 10 2018 00:00:00 GMT-0500 (Eastern Standard Time)
|
|
104
|
+
- Tue Mar 20 2018 00:00:00 GMT-0400 (Eastern Daylight Time)
|
|
105
|
+
- Sun Apr 01 2018 00:00:00 GMT-0400 (Eastern Daylight Time)
|
|
106
|
+
- Sun Apr 15 2018 00:00:00 GMT-0400 (Eastern Daylight Time)
|
|
107
|
+
- Thu May 10 2018 00:00:00 GMT-0400 (Eastern Daylight Time)
|
|
108
|
+
- name: start_date_year
|
|
109
|
+
sql: EXTRACT(YEAR FROM start_date)
|
|
110
|
+
type: number
|
|
111
|
+
description: Year extracted from start_date
|
|
112
|
+
virtual: true
|
|
113
|
+
- name: start_date_month
|
|
114
|
+
sql: TO_CHAR(start_date, 'YYYY-MM')
|
|
115
|
+
type: string
|
|
116
|
+
description: Year-month extracted from start_date
|
|
117
|
+
virtual: true
|
|
118
|
+
measures:
|
|
119
|
+
- name: person_count
|
|
120
|
+
sql: id
|
|
121
|
+
type: count_distinct
|
|
122
|
+
joins:
|
|
123
|
+
- target_entity: Companies
|
|
124
|
+
relationship: many_to_one
|
|
125
|
+
join_columns:
|
|
126
|
+
from: company_id
|
|
127
|
+
to: id
|
|
128
|
+
description: Each person belongs to one company
|
|
129
|
+
use_cases:
|
|
130
|
+
- Use for segmentation analysis by department, seniority
|
|
131
|
+
- Use for time-series analysis using start_date
|
|
132
|
+
- Join with companies for cross-entity analysis
|
|
133
|
+
query_patterns:
|
|
134
|
+
- description: People by department
|
|
135
|
+
sql: |-
|
|
136
|
+
SELECT department, COUNT(*) as count
|
|
137
|
+
FROM people
|
|
138
|
+
GROUP BY department
|
|
139
|
+
ORDER BY count DESC
|
|
140
|
+
- description: People by seniority
|
|
141
|
+
sql: |-
|
|
142
|
+
SELECT seniority, COUNT(*) as count
|
|
143
|
+
FROM people
|
|
144
|
+
GROUP BY seniority
|
|
145
|
+
ORDER BY count DESC
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
terms:
|
|
2
|
+
name:
|
|
3
|
+
status: ambiguous
|
|
4
|
+
note: '"name" appears in multiple tables: companies, people. ASK the user which table they mean.'
|
|
5
|
+
possible_mappings:
|
|
6
|
+
- companies.name
|
|
7
|
+
- people.name
|
|
8
|
+
company:
|
|
9
|
+
status: defined
|
|
10
|
+
definition: Refers to the companies entity. Linked via accounts.company_id → companies.id.
|
|
11
|
+
plan:
|
|
12
|
+
status: defined
|
|
13
|
+
definition: 'Categorical field on accounts. Possible values: Enterprise, Free, Pro, Starter.'
|
|
14
|
+
status:
|
|
15
|
+
status: defined
|
|
16
|
+
definition: 'Categorical field on accounts. Possible values: Active, Churned, Inactive, Suspended.'
|
|
17
|
+
department:
|
|
18
|
+
status: defined
|
|
19
|
+
definition: 'Categorical field on people. Possible values: Engineering, Finance, Marketing, Operations, Product, Sales.'
|
|
20
|
+
seniority:
|
|
21
|
+
status: defined
|
|
22
|
+
definition: 'Categorical field on people. Possible values: Executive, Junior, Mid, Senior.'
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
metrics:
|
|
2
|
+
- id: accounts_count
|
|
3
|
+
label: Total Accounts
|
|
4
|
+
description: Count of distinct accounts records.
|
|
5
|
+
type: atomic
|
|
6
|
+
sql: |-
|
|
7
|
+
SELECT COUNT(DISTINCT id) as count
|
|
8
|
+
FROM accounts
|
|
9
|
+
aggregation: count_distinct
|
|
10
|
+
- id: total_monthly_value
|
|
11
|
+
label: Total monthly value
|
|
12
|
+
description: Sum of monthly_value across all accounts.
|
|
13
|
+
type: atomic
|
|
14
|
+
source:
|
|
15
|
+
entity: Accounts
|
|
16
|
+
measure: total_monthly_value
|
|
17
|
+
sql: |-
|
|
18
|
+
SELECT SUM(monthly_value) as total_monthly_value
|
|
19
|
+
FROM accounts
|
|
20
|
+
aggregation: sum
|
|
21
|
+
objective: maximize
|
|
22
|
+
- id: avg_monthly_value
|
|
23
|
+
label: Average monthly value
|
|
24
|
+
description: Average monthly_value per account.
|
|
25
|
+
type: atomic
|
|
26
|
+
sql: |-
|
|
27
|
+
SELECT AVG(monthly_value) as avg_monthly_value
|
|
28
|
+
FROM accounts
|
|
29
|
+
aggregation: avg
|
|
30
|
+
- id: monthly_value_by_plan
|
|
31
|
+
label: monthly value by plan
|
|
32
|
+
description: monthly_value broken down by plan.
|
|
33
|
+
type: atomic
|
|
34
|
+
sql: |-
|
|
35
|
+
SELECT plan, SUM(monthly_value) as total_monthly_value, AVG(monthly_value) as avg_monthly_value, COUNT(*) as count
|
|
36
|
+
FROM accounts
|
|
37
|
+
GROUP BY plan
|
|
38
|
+
ORDER BY total_monthly_value DESC
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
metrics:
|
|
2
|
+
- id: companies_count
|
|
3
|
+
label: Total Companies
|
|
4
|
+
description: Count of distinct companies records.
|
|
5
|
+
type: atomic
|
|
6
|
+
sql: |-
|
|
7
|
+
SELECT COUNT(DISTINCT id) as count
|
|
8
|
+
FROM companies
|
|
9
|
+
aggregation: count_distinct
|
|
10
|
+
- id: total_employee_count
|
|
11
|
+
label: Total employee count
|
|
12
|
+
description: Sum of employee_count across all companies.
|
|
13
|
+
type: atomic
|
|
14
|
+
source:
|
|
15
|
+
entity: Companies
|
|
16
|
+
measure: total_employee_count
|
|
17
|
+
sql: |-
|
|
18
|
+
SELECT SUM(employee_count) as total_employee_count
|
|
19
|
+
FROM companies
|
|
20
|
+
aggregation: sum
|
|
21
|
+
objective: maximize
|
|
22
|
+
- id: avg_employee_count
|
|
23
|
+
label: Average employee count
|
|
24
|
+
description: Average employee_count per company.
|
|
25
|
+
type: atomic
|
|
26
|
+
sql: |-
|
|
27
|
+
SELECT AVG(employee_count) as avg_employee_count
|
|
28
|
+
FROM companies
|
|
29
|
+
aggregation: avg
|
|
30
|
+
- id: total_founded_year
|
|
31
|
+
label: Total founded year
|
|
32
|
+
description: Sum of founded_year across all companies.
|
|
33
|
+
type: atomic
|
|
34
|
+
source:
|
|
35
|
+
entity: Companies
|
|
36
|
+
measure: total_founded_year
|
|
37
|
+
sql: |-
|
|
38
|
+
SELECT SUM(founded_year) as total_founded_year
|
|
39
|
+
FROM companies
|
|
40
|
+
aggregation: sum
|
|
41
|
+
objective: maximize
|
|
42
|
+
- id: avg_founded_year
|
|
43
|
+
label: Average founded year
|
|
44
|
+
description: Average founded_year per company.
|
|
45
|
+
type: atomic
|
|
46
|
+
sql: |-
|
|
47
|
+
SELECT AVG(founded_year) as avg_founded_year
|
|
48
|
+
FROM companies
|
|
49
|
+
aggregation: avg
|
|
50
|
+
- id: total_revenue
|
|
51
|
+
label: Total revenue
|
|
52
|
+
description: Sum of revenue across all companies.
|
|
53
|
+
type: atomic
|
|
54
|
+
source:
|
|
55
|
+
entity: Companies
|
|
56
|
+
measure: total_revenue
|
|
57
|
+
sql: |-
|
|
58
|
+
SELECT SUM(revenue) as total_revenue
|
|
59
|
+
FROM companies
|
|
60
|
+
aggregation: sum
|
|
61
|
+
objective: maximize
|
|
62
|
+
- id: avg_revenue
|
|
63
|
+
label: Average revenue
|
|
64
|
+
description: Average revenue per company.
|
|
65
|
+
type: atomic
|
|
66
|
+
sql: |-
|
|
67
|
+
SELECT AVG(revenue) as avg_revenue
|
|
68
|
+
FROM companies
|
|
69
|
+
aggregation: avg
|
|
70
|
+
- id: total_valuation
|
|
71
|
+
label: Total valuation
|
|
72
|
+
description: Sum of valuation across all companies.
|
|
73
|
+
type: atomic
|
|
74
|
+
source:
|
|
75
|
+
entity: Companies
|
|
76
|
+
measure: total_valuation
|
|
77
|
+
sql: |-
|
|
78
|
+
SELECT SUM(valuation) as total_valuation
|
|
79
|
+
FROM companies
|
|
80
|
+
aggregation: sum
|
|
81
|
+
objective: maximize
|
|
82
|
+
- id: avg_valuation
|
|
83
|
+
label: Average valuation
|
|
84
|
+
description: Average valuation per company.
|
|
85
|
+
type: atomic
|
|
86
|
+
sql: |-
|
|
87
|
+
SELECT AVG(valuation) as avg_valuation
|
|
88
|
+
FROM companies
|
|
89
|
+
aggregation: avg
|