Skip to content

Config

The SQLite extension can be configured using either a configuration file (graft.toml) or environment variables.

The extension searches for the configuration file in the current directory or in the following standard locations:

PlatformConfiguration PathExample
Linux & macOS$XDG_CONFIG_HOME/graft/graft.toml/home/alice/.config/graft/graft.toml
Windows%APPDATA%\graft\graft.tomlC:\Users\Alice\AppData\Roaming\graft\graft.toml

If the GRAFT_CONFIG environment variable is set it will be used instead of searching.

  • Environment variable: GRAFT_DIR
  • Description: Path to the directory where Graft stores its local data (Fjall LSM storage).
  • Default:
    • Linux & macOS: $XDG_DATA_HOME/graft or ~/.local/share/graft
    • Windows: %LOCALAPPDATA%\graft or C:\Users\%USERNAME%\AppData\Local\graft

Configuration for remote object storage. This is where Graft stores the source of truth for your data.

In-memory object storage. Useful for testing and development.

[remote]
type = "memory"

Local filesystem storage. Good for development and single-machine deployments.

[remote]
type = "fs"
root = "/path/to/storage"
  • root: Path to the directory where remote data is stored.

S3-compatible object storage (AWS S3, MinIO, R2, etc.). Recommended for production.

[remote]
type = "s3_compatible"
bucket = "my-graft-bucket"
prefix = "optional/prefix" # optional
  • bucket: S3 bucket name.
  • prefix: Optional path prefix within the bucket.

Credentials: S3 credentials and configuration are loaded from standard AWS environment variables:

  • AWS_ACCESS_KEY_ID
  • AWS_SECRET_ACCESS_KEY
  • AWS_REGION
  • AWS_ENDPOINT (for S3-compatible services like MinIO, R2, etc.)
  • Environment variable: GRAFT_AUTOSYNC
  • Description: Background synchronization interval in seconds. When set, Graft will automatically sync volumes with the remote at this interval.
  • Default: Not set (no automatic synchronization)
  • Example: autosync = 60 (sync every 60 seconds)
  • Environment variable: GRAFT_LOG_FILE
  • Description: Write a verbose log of all Graft operations to the specified log file. Verbosity can be controlled using the RUST_LOG environment variable.
  • Valid verbosity levels: error, warn, info, debug, trace
  • Environment variable: GRAFT_MAKE_DEFAULT
  • Description: Cause the Graft VFS to become the default VFS for all new database connections.
data_dir = "/var/lib/graft"
autosync = 60
[remote]
type = "s3_compatible"
bucket = "my-app-graft"
prefix = "prod"

Set environment variables:

Terminal window
export AWS_ACCESS_KEY_ID="your-access-key"
export AWS_SECRET_ACCESS_KEY="your-secret-key"
export AWS_REGION="us-east-1"
data_dir = "./data"
[remote]
type = "fs"
root = "./remote-storage"
[remote]
type = "memory"