NAME

Net::Blossom::Server::Backend::Postgres::BlobStore - PostgreSQL large-object bytes

DESCRIPTION

This module implements Net::Blossom::Server::BlobStore using PostgreSQL large objects. It stores bytes by opaque storage key and contains no descriptor or owner logic.

Use the same DBI handle for the paired Net::Blossom::Server::Backend::Postgres::MetadataStore so their changes share one transaction.

CONSTRUCTOR

new

my $blobs = Net::Blossom::Server::Backend::Postgres::BlobStore->new(
    dbh => $dbh,
);

Creates a blob store in the current PostgreSQL schema using a PostgreSQL DBI handle with AutoCommit enabled.

METHODS

dbh

Returns the PostgreSQL DBI handle.

schema

Returns the schema selected when the component was created.

deploy_schema

Creates the storage-key to large-object table.

begin_upload

Starts a staged upload implementing the Net::Blossom::Server::BlobStore upload contract. Its prepare method requires an active transaction on dbh; the top-level PostgreSQL backend manages this transaction.

get_blob

Returns a streaming large-object body by storage key, or undef.

get_blob_range

Seeks within the PostgreSQL large object and returns a stream bounded to the requested zero-based offset and positive length, or undef when absent. When size is supplied, a range beyond that size is rejected.

delete_blob

Unlinks and removes a large object by storage key. It requires an active transaction on dbh.

BUILDARGS

Validates and normalizes constructor arguments for Class::Tiny.