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:
| Platform | Configuration Path | Example |
|---|---|---|
| Linux & macOS | $XDG_CONFIG_HOME/graft/graft.toml | /home/alice/.config/graft/graft.toml |
| Windows | %APPDATA%\graft\graft.toml | C:\Users\Alice\AppData\Roaming\graft\graft.toml |
If the GRAFT_CONFIG environment variable is set it will be used instead of searching.
Configuration Options
Section titled “Configuration Options”data_dir
Section titled “data_dir”- Environment variable:
GRAFT_DIR - Description: Path to the directory where Graft stores its local data (Fjall LSM storage).
- Default:
- Linux & macOS:
$XDG_DATA_HOME/graftor~/.local/share/graft - Windows:
%LOCALAPPDATA%\graftorC:\Users\%USERNAME%\AppData\Local\graft
- Linux & macOS:
remote
Section titled “remote”Configuration for remote object storage. This is where Graft stores the source of truth for your data.
remote.type = "memory"
Section titled “remote.type = "memory"”In-memory object storage. Useful for testing and development.
[remote]type = "memory"remote.type = "fs"
Section titled “remote.type = "fs"”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.
remote.type = "s3_compatible"
Section titled “remote.type = "s3_compatible"”S3-compatible object storage (AWS S3, MinIO, R2, etc.). Recommended for production.
[remote]type = "s3_compatible"bucket = "my-graft-bucket"prefix = "optional/prefix" # optionalbucket: 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_IDAWS_SECRET_ACCESS_KEYAWS_REGIONAWS_ENDPOINT(for S3-compatible services like MinIO, R2, etc.)
autosync
Section titled “autosync”- 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)
log_file
Section titled “log_file”- 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_LOGenvironment variable. - Valid verbosity levels:
error,warn,info,debug,trace
make_default
Section titled “make_default”- Environment variable:
GRAFT_MAKE_DEFAULT - Description: Cause the Graft VFS to become the default VFS for all new database connections.
Example Configurations
Section titled “Example Configurations”Production (S3)
Section titled “Production (S3)”data_dir = "/var/lib/graft"autosync = 60
[remote]type = "s3_compatible"bucket = "my-app-graft"prefix = "prod"Set environment variables:
export AWS_ACCESS_KEY_ID="your-access-key"export AWS_SECRET_ACCESS_KEY="your-secret-key"export AWS_REGION="us-east-1"Development (Filesystem)
Section titled “Development (Filesystem)”data_dir = "./data"
[remote]type = "fs"root = "./remote-storage"Testing (In-Memory)
Section titled “Testing (In-Memory)”[remote]type = "memory"