This project is a Go implementation of the Cube.js schema compiler, designed to transform Cube.js schema definitions into SQL queries.
gocube/
├── go.mod
├── go.sum
├── README.md
├── internal/
│ ├── query/ # Core query processing
│ ├── adapters/ # Database adapters (PostgreSQL, MySQL, etc.)
│ ├── filters/ # Filter processing
│ ├── dimensions/ # Dimension and measure processing
│ ├── joins/ # Join processing
│ ├── preagg/ # Pre-aggregation support
│ ├── params/ # Parameter allocation
│ └── compiler/ # Schema compilation
├── pkg/
│ └── schema/ # Public schema types and definitions
├── examples/
└── tests/
We're using Test-Driven Development (TDD) to port the Cube.js schema compiler functionality:
- Write failing tests based on Cube.js behavior
- Implement minimal code to pass the tests
- Refactor and optimize while keeping tests green
go mod tidy
go test ./...Based on our analysis of the Cube.js schema compiler, we're implementing in phases:
- Base Query Engine
- Parameter Allocation
- PostgreSQL & MySQL Adapters
- Filter Processing
- Dimension/Measure Processing
- Time Dimensions
- Join Processing
- Ordering and Limiting
- Advanced Filters
- Pre-aggregations
- SQL Server Adapter
- BigQuery Adapter
- Snowflake Adapter
- ClickHouse Adapter
- Query Caching
- Query Optimization
- Advanced Pre-aggregations
- Query Planning