SlateDB CLI
A command-line interface for interacting with SlateDB databases.
Installation
From Cargo
From Source
Clone the repository and build from source:
The binary will be available at target/release/slatedb.
Usage
The SlateDB CLI provides various commands for interacting with SlateDB databases:
Global Options
-e, --env-file <ENV_FILE>: A .env file to use to supply environment variables-p, --path <PATH>: The path in the object store to the root directory, starting from within the object store bucket (specified when configuring the object store provider)-h, --help: Print help information-V, --version: Print version information
Commands
Read Manifest
Reads the latest manifest file and outputs a readable string representation:
Options:
-i, --id <ID>: Specify a specific manifest ID to read. If not specified, the latest manifest will be returned.
List Manifests
Lists all available manifests:
Options:
-s, --start <START>: Optionally specify a start ID for the range of manifests to lookup-e, --end <END>: Optionally specify an end ID for the range of manifests to lookup
Checkpoints
SlateDB supports creating, refreshing, deleting, and listing checkpoints:
Create Checkpoint
Options:
-l, --lifetime <LIFETIME>: Optionally specify a lifetime for the created checkpoint in a human-friendly format (e.g., "7days 30min 10s"). Without this, the checkpoint has no expiry.-s, --source <SOURCE>: Optionally specify the UUID of an existing checkpoint to use as the base for the newly created checkpoint. If not provided, the checkpoint will be taken against the latest manifest.
Refresh Checkpoint
Options:
-i, --id <ID>: The UUID of the checkpoint to refresh (required)-l, --lifetime <LIFETIME>: Optionally specify a new lifetime for the checkpoint. Without this, the checkpoint is updated with no expiry.
Delete Checkpoint
Options:
-i, --id <ID>: The UUID of the checkpoint to delete (required)
List Checkpoints
Garbage Collection
SlateDB provides garbage collection functionality for various resources:
Run Garbage Collection Once
Options:
-r, --resource <RESOURCE>: The type of resource to clean up. Possible values:manifest,wal,compacted-m, --min-age <MIN_AGE>: The minimum age of the resource before considering it for garbage collection (e.g., "24h", "7days")
Schedule Garbage Collection
Options (at least one required):
--manifest <MANIFEST>: Configuration for manifest garbage collection, in the formatmin_age=<duration>,period=<duration>(e.g.,min_age=7days,period=1day)--wal <WAL>: Configuration for WAL garbage collection, in the formatmin_age=<duration>,period=<duration>--compacted <COMPACTED>: Configuration for compacted SST garbage collection, in the formatmin_age=<duration>,period=<duration>
Examples
Reading the Latest Manifest
Listing Manifests
Creating a Checkpoint with 7-Day Expiry
Running Garbage Collection on WAL Files
Scheduling Periodic Garbage Collection
Environment Variables
SlateDB CLI uses environment variables for object store configuration. You can either set these in your environment or provide them through an .env file using the --env-file option.
Required environment variables will depend on your chosen object store provider. See the SlateDB documentation for more details.
License
Apache-2.0