Skip to content
potluckdb

Storage

Objective-C: also in Python · Node · Go · Rust · Swift · Dart · Java and Kotlin · .NET · 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.

[PLKStorage remoteFromS3Bucket:inNamespace:region:endpoint:forcePathStyle:accessKeyID:secretAccessKey:sessionToken:options:error:]

Section titled “[PLKStorage remoteFromS3Bucket:inNamespace:region:endpoint:forcePathStyle:accessKeyID:secretAccessKey:sessionToken:options:error:]”
+ (nullable PLKRemote *)remoteFromS3Bucket:(NSString *)bucket
inNamespace:(NSString *)databaseNamespace
region:(nullable NSString *)region
endpoint:(nullable NSString *)endpoint
forcePathStyle:(BOOL)forcePathStyle
accessKeyID:(nullable NSString *)accessKeyID
secretAccessKey:
(nullable NSString *)secretAccessKey
sessionToken:(nullable NSString *)sessionToken
options:(nullable PLKRemoteOptions *)options
error:(NSError **)error;

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.

  • remoteFromS3Bucket: The bucket holding the objects.
  • inNamespace: 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 with secretAccessKey, or supply neither.
  • secretAccessKey: The secret for accessKeyID.
  • sessionToken: The session token for temporary credentials.
  • options: Remote concurrency and retention, as elsewhere in the SDK.

[PLKStorage remoteFromGCSBucket:inNamespace:endpoint:serviceAccount:options:error:]

Section titled “[PLKStorage remoteFromGCSBucket:inNamespace:endpoint:serviceAccount:options:error:]”
+ (nullable PLKRemote *)remoteFromGCSBucket:(NSString *)bucket
inNamespace:(NSString *)databaseNamespace
endpoint:(nullable NSString *)endpoint
serviceAccount:
(nullable NSString *)serviceAccount
options:(nullable PLKRemoteOptions *)options
error:(NSError **)error;

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.

  • remoteFromGCSBucket: The bucket holding the objects.
  • inNamespace: 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.
  • options: Remote concurrency and retention, as elsewhere in the SDK.

[PLKStorage remoteFromAzureAccount:container:inNamespace:endpoint:accountKey:options:error:]

Section titled “[PLKStorage remoteFromAzureAccount:container:inNamespace:endpoint:accountKey:options:error:]”
+ (nullable PLKRemote *)remoteFromAzureAccount:(NSString *)account
container:(NSString *)container
inNamespace:
(NSString *)databaseNamespace
endpoint:(nullable NSString *)endpoint
accountKey:(nullable NSString *)accountKey
options:
(nullable PLKRemoteOptions *)options
error:(NSError **)error;

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.

  • remoteFromAzureAccount: The storage account holding the container.
  • container: The container holding the objects.
  • inNamespace: 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.
  • options: Remote concurrency and retention, as elsewhere in the SDK.