Skip to content

[pull] master from cube-js:master #59

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ rust/cubesql/profile.json
.cubestore
.env
.vimspector.json
.claude/settings.local.json
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [1.3.43](https://github.com/cube-js/cube/compare/v1.3.42...v1.3.43) (2025-07-24)

### Bug Fixes

- **server-core:** Fix getCompilersInstances to not return compiler promise ([#9814](https://github.com/cube-js/cube/issues/9814)) ([5622a73](https://github.com/cube-js/cube/commit/5622a732c6e6a25f9bda35a68e2faf61a3ae04e3))
- **snowflake-driver:** Set date/timestamp format for exporting data to CSV export bucket ([#9810](https://github.com/cube-js/cube/issues/9810)) ([4c0fef7](https://github.com/cube-js/cube/commit/4c0fef7b068893322f05310b028059ea3dad8986))

## [1.3.42](https://github.com/cube-js/cube/compare/v1.3.41...v1.3.42) (2025-07-23)

### Bug Fixes
Expand Down
137 changes: 137 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## Repository Overview

Cube is a semantic layer for building data applications. This is a monorepo containing the complete Cube ecosystem including:
- Cube backend server and core components
- Client libraries for JavaScript/React/Vue/Angular
- Database drivers for various data sources
- Documentation site
- Rust components (CubeSQL, CubeStore)

## Development Commands

**Note: This project uses Yarn as the package manager.**

### Core Build Commands
```bash
# Build all packages
yarn build

# Run TypeScript compilation across all packages
yarn tsc

# Watch mode for TypeScript compilation
yarn tsc:watch

# Clean build artifacts
yarn clean

# Run linting across all packages
yarn lint

# Fix linting issues
yarn lint:fix

# Lint package.json files
yarn lint:npm
```

### Testing Commands
```bash
# Run tests (most packages have individual test commands)
yarn test

# Test individual packages
cd packages/cubejs-[package-name]
yarn test
```

### Documentation Development
The documentation is in `/docs` directory:
```bash
cd docs
yarn dev # Start development server
yarn build # Build for production
```

## Architecture Overview

### Monorepo Structure
- **`/packages`**: All JavaScript/TypeScript packages managed by Lerna
- Core packages: `cubejs-server-core`, `cubejs-schema-compiler`, `cubejs-query-orchestrator`
- Client libraries: `cubejs-client-core`, `cubejs-client-react`, etc.
- Database drivers: `cubejs-postgres-driver`, `cubejs-bigquery-driver`, etc.
- API layer: `cubejs-api-gateway`
- **`/rust`**: Rust components including CubeSQL (SQL interface) and CubeStore (distributed storage)
- **`/docs`**: Next.js documentation site
- **`/examples`**: Example implementations and recipes

### Key Components
1. **Schema Compiler**: Compiles data models into executable queries
2. **Query Orchestrator**: Manages query execution, caching, and pre-aggregations
3. **API Gateway**: Provides REST, GraphQL, and SQL APIs
4. **CubeSQL**: Postgres-compatible SQL interface (Rust)
5. **CubeStore**: Distributed OLAP storage engine (Rust)

### Package Management
- Uses Yarn workspaces with Lerna for package management
- TypeScript compilation is coordinated across packages
- Jest for unit testing with package-specific configurations

## Testing Approach

### Unit Tests
- Most packages have Jest-based unit tests in `/test` directories
- TypeScript packages use `jest.config.js` with TypeScript compilation
- Snapshot testing for SQL compilation and query planning

### Integration Tests
- Driver-specific integration tests in `/packages/cubejs-testing-drivers`
- End-to-end tests in `/packages/cubejs-testing`
- Docker-based testing environments for database drivers

### Test Commands
```bash
# Individual package testing
cd packages/[package-name]
yarn test

# Driver integration tests (requires Docker)
cd packages/cubejs-testing-drivers
yarn test
```

## Development Workflow

1. **Making Changes**: Work in individual packages, changes are coordinated via Lerna
2. **Building**: Use `yarn tsc` to compile TypeScript across all packages
3. **Testing**: Run relevant tests for modified packages
4. **Linting**: Ensure code passes `yarn lint` before committing

## Common File Patterns

- `*.test.ts/js`: Jest unit tests
- `jest.config.js`: Jest configuration per package
- `tsconfig.json`: TypeScript configuration (inherits from root)
- `CHANGELOG.md`: Per-package changelogs maintained by Lerna
- `src/`: Source code directory
- `dist/`: Compiled output (not committed)

## Important Notes

- This is documentation for the old Cube docs site structure (the existing `/docs/CLAUDE.md` refers to the documentation site)
- The main Cube application development happens in `/packages`
- For data model changes, focus on `cubejs-schema-compiler` package
- For query execution changes, focus on `cubejs-query-orchestrator` package
- Database connectivity is handled by individual driver packages

## Key Dependencies

- **Lerna**: Monorepo management and publishing
- **TypeScript**: Primary language for most packages
- **Jest**: Testing framework
- **Rollup**: Bundling for client libraries
- **Docker**: Testing environments for database drivers
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.3.42",
"version": "1.3.43",
"npmClient": "yarn",
"command": {
"bootstrap": {
Expand Down
4 changes: 4 additions & 0 deletions packages/cubejs-api-gateway/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [1.3.43](https://github.com/cube-js/cube/compare/v1.3.42...v1.3.43) (2025-07-24)

**Note:** Version bump only for package @cubejs-backend/api-gateway

## [1.3.42](https://github.com/cube-js/cube/compare/v1.3.41...v1.3.42) (2025-07-23)

**Note:** Version bump only for package @cubejs-backend/api-gateway
Expand Down
8 changes: 4 additions & 4 deletions packages/cubejs-api-gateway/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@cubejs-backend/api-gateway",
"description": "Cube.js API Gateway",
"author": "Cube Dev, Inc.",
"version": "1.3.42",
"version": "1.3.43",
"repository": {
"type": "git",
"url": "https://github.com/cube-js/cube.git",
Expand All @@ -27,8 +27,8 @@
"dist/src/*"
],
"dependencies": {
"@cubejs-backend/native": "1.3.42",
"@cubejs-backend/shared": "1.3.42",
"@cubejs-backend/native": "1.3.43",
"@cubejs-backend/shared": "1.3.43",
"@ungap/structured-clone": "^0.3.4",
"assert-never": "^1.4.0",
"body-parser": "^1.19.0",
Expand All @@ -51,7 +51,7 @@
"uuid": "^8.3.2"
},
"devDependencies": {
"@cubejs-backend/linter": "1.3.42",
"@cubejs-backend/linter": "1.3.43",
"@types/express": "^4.17.21",
"@types/jest": "^29",
"@types/jsonwebtoken": "^9.0.2",
Expand Down
3 changes: 0 additions & 3 deletions packages/cubejs-api-gateway/src/SubscriptionServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ const methodParams: Record<string, string[]> = {
meta: [],
subscribe: ['query', 'queryType'],
unsubscribe: [],
'subscribe.queue.events': []
};

const calcMessageLength = (message: unknown) => Buffer.byteLength(
Expand Down Expand Up @@ -149,8 +148,6 @@ export class SubscriptionServer {
}

public async disconnect(connectionId: string) {
const authContext = await this.subscriptionStore.getAuthContext(connectionId);
await this.apiGateway.unSubscribeQueueEvents({ context: authContext, connectionId });
await this.subscriptionStore.cleanupSubscriptions(connectionId);
}

Expand Down
15 changes: 0 additions & 15 deletions packages/cubejs-api-gateway/src/gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2067,21 +2067,6 @@ class ApiGateway {
}
}

public async subscribeQueueEvents({ context, signedWithPlaygroundAuthSecret, connectionId, res }) {
if (this.enforceSecurityChecks && !signedWithPlaygroundAuthSecret) {
throw new CubejsHandlerError(
403,
'Forbidden',
'Only for signed with playground auth secret'
);
}
return (await this.getAdapterApi(context)).subscribeQueueEvents(connectionId, res);
}

public async unSubscribeQueueEvents({ context, connectionId }) {
return (await this.getAdapterApi(context)).unSubscribeQueueEvents(connectionId);
}

public async subscribe({
query, context, res, subscribe, subscriptionState, queryType, apiType
}) {
Expand Down
4 changes: 4 additions & 0 deletions packages/cubejs-athena-driver/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [1.3.43](https://github.com/cube-js/cube/compare/v1.3.42...v1.3.43) (2025-07-24)

**Note:** Version bump only for package @cubejs-backend/athena-driver

## [1.3.42](https://github.com/cube-js/cube/compare/v1.3.41...v1.3.42) (2025-07-23)

**Note:** Version bump only for package @cubejs-backend/athena-driver
Expand Down
10 changes: 5 additions & 5 deletions packages/cubejs-athena-driver/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@cubejs-backend/athena-driver",
"description": "Cube.js Athena database driver",
"author": "Cube Dev, Inc.",
"version": "1.3.42",
"version": "1.3.43",
"repository": {
"type": "git",
"url": "https://github.com/cube-js/cube.git",
Expand All @@ -29,13 +29,13 @@
"types": "dist/src/index.d.ts",
"dependencies": {
"@aws-sdk/client-athena": "^3.22.0",
"@cubejs-backend/base-driver": "1.3.42",
"@cubejs-backend/shared": "1.3.42",
"@cubejs-backend/base-driver": "1.3.43",
"@cubejs-backend/shared": "1.3.43",
"sqlstring": "^2.3.1"
},
"devDependencies": {
"@cubejs-backend/linter": "1.3.42",
"@cubejs-backend/testing-shared": "1.3.42",
"@cubejs-backend/linter": "1.3.43",
"@cubejs-backend/testing-shared": "1.3.43",
"@types/ramda": "^0.27.40",
"typescript": "~5.2.2"
},
Expand Down
4 changes: 4 additions & 0 deletions packages/cubejs-backend-cloud/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [1.3.43](https://github.com/cube-js/cube/compare/v1.3.42...v1.3.43) (2025-07-24)

**Note:** Version bump only for package @cubejs-backend/cloud

## [1.3.42](https://github.com/cube-js/cube/compare/v1.3.41...v1.3.42) (2025-07-23)

**Note:** Version bump only for package @cubejs-backend/cloud
Expand Down
6 changes: 3 additions & 3 deletions packages/cubejs-backend-cloud/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cubejs-backend/cloud",
"version": "1.3.42",
"version": "1.3.43",
"description": "Cube Cloud package",
"main": "dist/src/index.js",
"typings": "dist/src/index.d.ts",
Expand All @@ -25,15 +25,15 @@
"devDependencies": {
"@babel/core": "^7.24.5",
"@babel/preset-env": "^7.24.5",
"@cubejs-backend/linter": "1.3.42",
"@cubejs-backend/linter": "1.3.43",
"@types/fs-extra": "^9.0.8",
"@types/jest": "^29",
"jest": "^29",
"typescript": "~5.2.2"
},
"dependencies": {
"@cubejs-backend/dotenv": "^9.0.2",
"@cubejs-backend/shared": "1.3.42",
"@cubejs-backend/shared": "1.3.43",
"chokidar": "^3.5.1",
"env-var": "^6.3.0",
"form-data": "^4.0.0",
Expand Down
4 changes: 4 additions & 0 deletions packages/cubejs-backend-maven/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [1.3.43](https://github.com/cube-js/cube/compare/v1.3.42...v1.3.43) (2025-07-24)

**Note:** Version bump only for package @cubejs-backend/maven

## [1.3.42](https://github.com/cube-js/cube/compare/v1.3.41...v1.3.42) (2025-07-23)

**Note:** Version bump only for package @cubejs-backend/maven
Expand Down
6 changes: 3 additions & 3 deletions packages/cubejs-backend-maven/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@cubejs-backend/maven",
"description": "Cube.js Maven Wrapper for java dependencies downloading",
"author": "Cube Dev, Inc.",
"version": "1.3.42",
"version": "1.3.43",
"license": "Apache-2.0",
"repository": {
"type": "git",
Expand Down Expand Up @@ -31,12 +31,12 @@
"dist/src/*"
],
"dependencies": {
"@cubejs-backend/shared": "1.3.42",
"@cubejs-backend/shared": "1.3.43",
"source-map-support": "^0.5.19",
"xmlbuilder2": "^2.4.0"
},
"devDependencies": {
"@cubejs-backend/linter": "1.3.42",
"@cubejs-backend/linter": "1.3.43",
"@types/jest": "^29",
"@types/node": "^20",
"jest": "^29",
Expand Down
4 changes: 4 additions & 0 deletions packages/cubejs-backend-native/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [1.3.43](https://github.com/cube-js/cube/compare/v1.3.42...v1.3.43) (2025-07-24)

**Note:** Version bump only for package @cubejs-backend/native

## [1.3.42](https://github.com/cube-js/cube/compare/v1.3.41...v1.3.42) (2025-07-23)

**Note:** Version bump only for package @cubejs-backend/native
Expand Down
8 changes: 4 additions & 4 deletions packages/cubejs-backend-native/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cubejs-backend/native",
"version": "1.3.42",
"version": "1.3.43",
"author": "Cube Dev, Inc.",
"description": "Native module for Cube.js (binding to Rust codebase)",
"main": "dist/js/index.js",
Expand Down Expand Up @@ -34,7 +34,7 @@
"dist/js"
],
"devDependencies": {
"@cubejs-backend/linter": "1.3.42",
"@cubejs-backend/linter": "1.3.43",
"@types/jest": "^29",
"@types/node": "^20",
"cargo-cp-artifact": "^0.1.9",
Expand All @@ -44,8 +44,8 @@
"uuid": "^8.3.2"
},
"dependencies": {
"@cubejs-backend/cubesql": "1.3.42",
"@cubejs-backend/shared": "1.3.42",
"@cubejs-backend/cubesql": "1.3.43",
"@cubejs-backend/shared": "1.3.43",
"@cubejs-infra/post-installer": "^0.0.7"
},
"resources": {
Expand Down
Loading
Loading