synology_apm_repo.sdk.units.saas.tree_strategy.named_group_recursive module

NamedGroupRecursiveTree: Site’s shape — parent-pointer recursion (parent_folder_id + a root id) nested within named groups, combining the two schema shapes every service-level DB in this project expands into (parent-pointer recursion; a flat list optionally grouped by one key).

class synology_apm_repo.sdk.units.saas.tree_strategy.named_group_recursive.NamedGroupRecursiveTree(provider, *, group_table, group_columns, group_id_column, group_name_column, leaf_table, leaf_columns, self_id_of, leaf_group_column, leaf_parent_column, folder, display_name, order_by=(), root_folder_id_of=None, order_by_sql=None)

Bases: object

Site’s shape: like NamedGroupFlatTree, but the inner table recurses via parent-pointer within each outer group instead of being flat (a document library’s nested folders).

self_id_of supplies each row’s own id (Site’s own file_id-or-item_id rule, not a plain column) — used only to build an outgoing child’s key, never to filter; the WHERE clause always compares against the stored leaf_parent_column value directly.

root_folder_id_of resolves each group’s own top-level anchor. Assuming every group’s top level is the empty string is wrong: a general List’s top level is parent_folder_id = "", but a document library’s top-level items instead share one non-empty list_version_table.root_folder_id value — without this, those top-level rows never match the WHERE clause and the library appears empty. Defaults to the empty string when a caller has no per-group anchor.

async children_of(key, *, offset=0, limit=None)
row_for(key)

None for a folder’s own key too, not just a missing one — a folder is never a restorable unit, so assemble() must never see its row even though the cache holds it for traversal.