SqlQueryBackend¶
- 
class lsst.daf.butler.registry.queries.SqlQueryBackend(db: Database, managers: RegistryManagerInstances)¶
- Bases: - lsst.daf.butler.registry.queries.QueryBackend- An implementation of - QueryBackendfor- SqlRegistry.- Parameters: - db : Database
- Object that abstracts the database engine. 
- managers : RegistryManagerInstances
- Struct containing the manager objects that back a - SqlRegistry.
 - Attributes Summary - managers- A struct containing the manager instances that back a SQL registry. - universe- Definition of all dimensions and dimension elements for this registry. - Methods Summary - resolve_collection_wildcard(expression, *, …)- Return the collection records that match a wildcard expression. - resolve_dataset_type_wildcard(expression, …)- Return the dataset types that match a wildcard expression. - resolve_single_dataset_type_wildcard(…)- Return a single dataset type that matches a wildcard expression. - Attributes Documentation - 
managers¶
- A struct containing the manager instances that back a SQL registry. - Notes - This property is a temporary interface that will be removed in favor of new methods once the manager and storage classes have been integrated with - Relation.
 - 
universe¶
- Definition of all dimensions and dimension elements for this registry. 
 - Methods Documentation - 
resolve_collection_wildcard(expression: Any, *, collection_types: Set[CollectionType] = frozenset({<CollectionType.RUN: 1>, <CollectionType.TAGGED: 2>, <CollectionType.CHAINED: 3>, <CollectionType.CALIBRATION: 4>}), done: set[str] | None = None, flatten_chains: bool = True, include_chains: bool | None = None) → list[CollectionRecord]¶
- Return the collection records that match a wildcard expression. - Parameters: - expression
- Names and/or patterns for collections; will be passed to - CollectionWildcard.from_expression.
- collection_types : collections.abc.Set[CollectionType], optional
- If provided, only yield collections of these types. 
- done : set[str], optional
- A set of collection names that should be skipped, updated to include all processed collection names on return. 
- flatten_chains : bool, optional
- If - True(default) recursively yield the child collections of- CHAINEDcollections.
- include_chains : bool, optional
- If - False, return records for- CHAINEDcollections themselves. The default is the opposite of- flattenChains: either return records for CHAINED collections or their children, but not both.
- Returns
- ——
- records : list[CollectionRecord]
- Matching collection records. 
 
 - 
resolve_dataset_type_wildcard(expression: Any, components: bool | None = None, missing: list[str] | None = None, explicit_only: bool = False) → dict[DatasetType, list[str | None]]¶
- Return the dataset types that match a wildcard expression. - Parameters: - expression
- Names and/or patterns for dataset types; will be passed to - DatasetTypeWildcard.from_expression.
- components : bool, optional
- If - True, apply all expression patterns to component dataset type names as well. If- False, never apply patterns to components. If- None(default), apply patterns to components only if their parent datasets were not matched by the expression. Fully-specified component datasets (- stror- DatasetTypeinstances) are always included.
- missing : listofstr, optional
- String dataset type names that were explicitly given (i.e. not regular expression patterns) but not found will be appended to this list, if it is provided. 
- explicit_only : bool, optional
- If - True, require explicit- DatasetTypeinstances or- strnames, with- re.Patterninstances deprecated and- ...prohibited.
 - Returns: 
 - 
resolve_single_dataset_type_wildcard(expression: Any, components: bool | None = None, explicit_only: bool = False) → tuple[DatasetType, list[str | None]]¶
- Return a single dataset type that matches a wildcard expression. - Parameters: - expression
- Names and/or patterns for the dataset type; will be passed to - DatasetTypeWildcard.from_expression.
- components : bool, optional
- If - True, apply all expression patterns to component dataset type names as well. If- False, never apply patterns to components. If- None(default), apply patterns to components only if their parent datasets were not matched by the expression. Fully-specified component datasets (- stror- DatasetTypeinstances) are always included.- Values other than - Falseare deprecated, and only- Falsewill be supported after v26. After v27 this argument will be removed entirely.
- explicit_only : bool, optional
- If - True, require explicit- DatasetTypeinstances or- strnames, with- re.Patterninstances deprecated and- ...prohibited.
 - Returns: - Notes - This method really finds a single parent dataset type and any number of components, because it’s only the parent dataset type that’s known to registry at all; many callers are expected to discard the - single_componentsreturn value.
 
- db :