lamindb.Storage#
- class lamindb.Storage(root: str, type: str, region: Optional[str])#
- class lamindb.Storage(*db_args)
Bases:
Registry
Storage locations: S3/GCP buckets or local directories.
Is auto-managed, no need to create objects.
See also
Examples
Configure the default storage location upon initiation of a LaminDB instance:
lamin init --storage ./mydata # or "s3://my-bucket" or "gs://my-bucket"
View the default storage location:
>>> ln.settings.storage PosixPath('/home/runner/work/lamindb/lamindb/docs/guide/mydata')
Set a new default storage (currently doesn’t support SQLite instances):
>>> ln.load("my-postgres-db") >>> ln.settings.storage = "./storage_2" # or a cloud bucket >>> ln.settings.storage PosixPath('/home/runner/work/lamindb-setup/lamindb-setup/docs/guide/storage_2')
Fields
- id CharField
Universal id, valid across DB instances.
- root CharField
Root path of storage, an s3 path, a local path, etc. (required).
- type CharField
Local vs. s3 vs. gcp etc.
- region CharField
Cloud storage region, if applicable.
- created_at DateTimeField
Time of creation of record.
- updated_at DateTimeField
Time of last update to record.
- created_by ForeignKey
Creator of record, a
User
.
Methods