Configuring Storage
Bitloops works out of the box with bundled SQLite and DuckDB. This guide covers how to configure alternative backends for teams or production environments.
PostgreSQL (Relational Store)
Replace SQLite with PostgreSQL for shared access or larger datasets.
Configuration
In .bitloops/config.json:
{
"stores": {
"relational": {
"provider": "postgres",
"postgres_dsn": "postgres://user:password@localhost:5432/bitloops"
}
}
}
Setup
- Create a PostgreSQL database
- Set the DSN in your config (or use environment variables:
"postgres_dsn": "${BITLOOPS_PG_DSN}") - Run
bitloops devql initto create the schema - Verify with
bitloops --connection-status
ClickHouse (Event Store)
Replace DuckDB with ClickHouse for high-volume analytics.
Configuration
{
"stores": {
"event": {
"provider": "clickhouse",
"clickhouse_url": "http://localhost:8123"
}
}
}
Setup
- Install and start ClickHouse
- Set the URL in your config
- Run
bitloops devql initto create the schema - Verify with
bitloops --connection-status
AWS S3 (Blob Store)
Replace local filesystem with S3 for centralized storage.
Configuration
{
"stores": {
"blob": {
"provider": "s3",
"s3_bucket": "your-bitloops-bucket",
"s3_region": "us-east-1"
}
}
}
AWS credentials are resolved from your environment (AWS CLI profile, environment variables, or IAM role).
Google Cloud Storage (Blob Store)
Configuration
{
"stores": {
"blob": {
"provider": "gcs",
"gcs_bucket": "your-bitloops-bucket"
}
}
}
GCS credentials are resolved from your environment (application default credentials or service account).
Mixed Configurations
You can mix and match backends. For example, keep SQLite for local development but use PostgreSQL in CI:
{
"stores": {
"relational": { "provider": "postgres", "postgres_dsn": "${BITLOOPS_PG_DSN}" },
"event": { "provider": "duckdb" },
"blob": { "provider": "s3", "s3_bucket": "my-team-bitloops" }
}
}
Verifying Configuration
After changing storage configuration:
# Re-initialize schema for new backends
bitloops devql init
# Check connectivity
bitloops --connection-status