Semantic Layer
Define your metrics once. Query them everywhere — dashboards, APIs, or AI agents. Powered by drizzle-cube.
- Code-first cubes built on your existing Drizzle ORM schemas
- AI-assisted cube generation from database introspection
- Consistent metric definitions across every query surface
Built on drizzle-cube
drizzle-cube sits between your queries and the database, translating cube queries to SQL with security context enforcement. It provides a unified analytics API on top of your existing Drizzle ORM schemas, so you never have to write raw SQL for analytics again.
How it works
Generate schemas from your database
Connect your database and Drizby introspects it to generate Drizzle ORM schemas directly from your existing tables. No manual schema writing required — just point at your database and go.
Define analytics cubes
Add measures (count, sum, avg), dimensions (columns, time), and joins to create a queryable semantic model. Or let AI generate cube definitions from your schemas automatically.
Query everywhere
Access your cubes through the REST API, dashboards, analysis builder, notebooks, or AI agents via MCP. Every query goes through the semantic layer with security context enforcement.
Full IDE Experience
Monaco editor with TypeScript autocomplete for Drizzle ORM and drizzle-cube types. Real-time compilation with inline error reporting. Write cubes with the same DX as VS Code.
AI-Powered Cube Generation
Point AI at your schemas and it generates cube definitions automatically. Supports Anthropic Claude, OpenAI, and Google Gemini for intelligent cube scaffolding.
Flexible Security Context
Apply any row-level constraint in TypeScript — group membership, tenant isolation, user roles, and more. Every cube query passes through the semantic layer with a security context you define, so access boundaries are enforced at the query layer.
Database Introspection
Auto-generate Drizzle schemas from existing databases. Connect to PostgreSQL, MySQL, SQLite, or any supported database and pull in table definitions instantly.