synology_apm_repo.sdk.units.saas.objectdb module

Embedded ObjectDB: object_id -> (offset, length) inside a saas_obj. It has no file_map path of its own: it is a small SQLite file embedded in the stream’s dedup content.

It is located only by an object_db_id string ("<streamUuid>_<offset>_<length>"), normally read from the version’s object-name index (object_name_index.py); a caller may also pass one by hand (the CLI’s --object-db-id).

synology_apm_repo.sdk.units.saas.objectdb.parse_object_db_id(object_db_id)

Parse an object_db_id string ("<streamUuid>_<offset>_<length>") into (stream_uuid, offset, length).

Raises:

NotFoundError – object_db_id isn’t shaped like <text>_<int>_<int>, each <int> ASCII digits only.

synology_apm_repo.sdk.units.saas.objectdb.name_object_id_pairs(items)

The (name, object_id) pairs in a parsed db_objects JSON array ([{"name": str, "object_id": str}, ...]), silently dropping malformed entries; [] when items isn’t a list.

class synology_apm_repo.sdk.units.saas.objectdb.ObjectDb

Bases: AsyncClosing

object_id -> (offset, length) lookup backed by one embedded ObjectDB slice, materialized via SqliteSource. Build one with from_bytes or load.

async classmethod from_bytes(data)

Open data (one ObjectDB slice) as SQLite.

Raises:
async classmethod load(dedup_file, offset, length)
async close()
async get(object_id)
async get_many(object_ids)

object_id -> (offset, length) for every id in object_ids that has a row, in one query; ids without a row are left out.

async object_map()

The full object_id -> (offset, length) mapping, ordered by object_id so pagination over it is stable.

async synology_apm_repo.sdk.units.saas.objectdb.read_object(object_db, dedup_file, object_id, *, expected_size=None)

Read one object’s bytes eagerly, for a caller that parses them (META JSON, mail fragments). Content handed back unmodified should stay a lazy dedup_file.view() instead.

Raises: