Storage
Go: also in Python · Node · Rust · Swift · Dart · Java and Kotlin · .NET · C++ · Objective-C
Remotes using storage services through the shared native storage library.
Concepts explains the remote and local store.
Each constructor returns an ordinary remote. Pass it to the same open call and close it the same way. The other reference pages apply to these remotes without change.
potluckdb.FromS3
Section titled “potluckdb.FromS3”func FromS3(options S3Options) (*Remote, error)
type S3Options struct { Bucket string Namespace string Region string Endpoint string ForcePathStyle bool AccessKeyID string SecretAccessKey string SessionToken string Remote *RemoteOptions}A remote over an S3-compatible bucket.
Credentials come from the AWS chain unless AccessKeyID and SecretAccessKey are supplied. aws-config resolves the chain itself:
- Environment
- Shared configuration and credentials files
- SSO
- Web identity
- Container and instance metadata
A storage service other than AWS is named by Endpoint. The AWS chain still supplies credentials unless AccessKeyID and SecretAccessKey are supplied, so supply the key pair that the service issues. Cloudflare R2 issues a pair with an account endpoint and requires Region set to “auto”. MinIO and most self-hosted gateways require ForcePathStyle. This addresses the bucket as a path segment instead of a subdomain.
Bucket: The bucket holding the objects.Namespace: The database’s prefix. One bucket can hold many databases.Region: The signing region. If absent, the AWS chain selects it.Endpoint: The endpoint of a storage service other than AWS.ForcePathStyle: Address the bucket as a path segment instead of a subdomain.AccessKeyID: An explicit access key. Supply it together withSecretAccessKey, or supply neither.SecretAccessKey: The secret forAccessKeyID.SessionToken: The session token for temporary credentials.Remote: Remote concurrency and retention, as elsewhere in the SDK.
potluckdb.FromGCS
Section titled “potluckdb.FromGCS”func FromGCS(options GCSOptions) (*Remote, error)
type GCSOptions struct { Bucket string Namespace string Endpoint string // ServiceAccount is the JSON key Google issues, as its own text. // Empty uses Application Default Credentials. ServiceAccount string Remote *RemoteOptions}A remote over a Google Cloud Storage bucket.
Unless ServiceAccount is supplied, google-cloud-auth resolves Application Default Credentials in this order:
GOOGLE_APPLICATION_CREDENTIALS- The gcloud user credentials file
- The metadata server
If the process has no such chain, pass Google’s service account JSON as JSON text. A storage service other than Google’s is named by Endpoint, including gateways and emulators.
Bucket: The bucket holding the objects.Namespace: The database’s prefix. One bucket can hold many databases.Endpoint: The endpoint of a storage service other than Google’s.ServiceAccount: Google’s service account JSON, as JSON text.Remote: Remote concurrency and retention, as elsewhere in the SDK.
potluckdb.FromAzure
Section titled “potluckdb.FromAzure”func FromAzure(options AzureOptions) (*Remote, error)
type AzureOptions struct { Account string Container string Namespace string // Endpoint reaches the library as endpoint_url. Azurite is one // account under one port, so its endpoint carries the account as a // path segment. Endpoint string // AccountKey is an explicit key. Empty uses the Azure chain. AccountKey string Remote *RemoteOptions}A remote over an Azure Blob Storage container.
Unless AccountKey is supplied, azure-identity resolves the Azure credential chain itself:
- Environment
- Workload identity
- Managed identity
- Azure CLI
- Developer tools
Pass an account key for a storage service without such a chain. Azurite supplies the well-known devstoreaccount1 pair.
A storage service other than Azure’s is named by Endpoint, passed to the library as endpoint_url. Azurite provides one account per port, so its endpoint includes the account as a path segment.
Account: The storage account holding the container.Container: The container holding the objects.Namespace: The database’s prefix. One container can hold many databases.Endpoint: The endpoint of a storage service other than Azure’s.AccountKey: An explicit account key.Remote: Remote concurrency and retention, as elsewhere in the SDK.