BlobGetting

class dsviper.BlobGetting

Bases: object

Retrieves blobs from a persistence layer.

Note: Not directly instantiable.

blob(blob_id: ValueBlobId) → ValueBlob | None

Return the bytes of the blob blob_id names, or None if it is not held here.

Raises past 2 GB, where the bytes cannot be handed over in one piece. Ask blob_info(blob_id).chunked() first, and read such a blob with read_blob.

A blob reserved and not yet sealed - create_zero_blob, then freeze_blob, on Databasing or CommitDatabasing - raises; blob_info answers None for it meanwhile.

blob_ids() → set[ValueBlobId]

Return the set of blob_id of every sealed blob.

A blob reserved and not yet sealed - create_zero_blob, then freeze_blob, on Databasing or CommitDatabasing - is left out.

blob_info(blob_id: ValueBlobId) → BlobInfo | None

Return the BlobInfo for blob_id, or None if there is no such blob.

It gives the layout, the size, whether the blob is chunked, and the rowid that reaches it. A blob reserved and not yet sealed answers None - create_zero_blob, then freeze_blob, on Databasing or CommitDatabasing.

blob_infos(blob_ids: set[ValueBlobId]) → list[BlobInfo]

Return one BlobInfo per blob_id of blob_ids this source holds.

An unknown blob_id is left out, so the list may be shorter than blob_ids.

blob_statistics() → BlobStatistics

Return the statistics for blobs.

read_blob(blob_id: ValueBlobId, size: int, offset: int) → ValueBlob

Return size bytes of the blob blob_id names, starting at offset.

The read side of the blob stream that wrote it, and the only way to read a blob past 2 GB, which blob() refuses.