Skip to content

[Bug] schema_index fails on Bun build because schema cache depends on better-sqlite3 #314

@grkosarev

Description

@grkosarev

Description

schema_index does not work in altimate-code 0.5.2 with a BigQuery connection because the released CLI appears to run on a Bun-based binary, while the schema cache depends on better-sqlite3, which Bun does not support.
In my case:

  • warehouse_test succeeds for the configured BigQuery connection
  • schema_index fails even after installing the dependencies suggested by the CLI
  • this makes schema-cache-based features unusable (schema_index, schema_cache_status, likely schema_search and sql_autocomplete too)
    This looks like a runtime incompatibility in the released CLI, not a warehouse connectivity problem.

Steps to Reproduce

  1. Install altimate-code 0.5.2 on macOS arm64
  2. Configure a BigQuery warehouse connection
  3. Run warehouse_test for the connection and confirm it succeeds
  4. Run schema_index for that warehouse
  5. If the CLI asks for missing dependencies, install them:
    • npm install @google-cloud/bigquery
    • npm install better-sqlite3
  6. Run schema_index again
  7. See the error:
    • Failed to index warehouse schema: 'better-sqlite3' is not yet supported in Bun.

Expected Behavior

After installing the required warehouse and cache dependencies, schema_index should complete successfully.
At minimum, the CLI should either:

  • use a Bun-compatible SQLite backend for schema cache
  • avoid suggesting better-sqlite3 in a Bun runtime where it cannot work
  • or provide a supported fallback/runtime path for schema indexing

Actual Behavior

warehouse_test succeeds, so the BigQuery connection is valid, but schema_index still fails due to the local schema cache implementation.
Observed errors during setup:

  • first: BigQuery driver not installed. Run: npm install @google-cloud/bigquery
  • after installing BigQuery driver and better-sqlite3:
    Failed to index warehouse schema: 'better-sqlite3' is not yet supported in Bun.
    As a result, schema indexing cannot be completed in the released CLI build.

Environment

  • OS: macOS 26.3 (arm64)
  • CLI version: 0.5.2
  • Python version: 3.12.11
  • Node version: v25.6.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions