DatabaseDimensionRecordQueryResults¶
- class lsst.daf.butler.registry.queries.DatabaseDimensionRecordQueryResults(dataIds: DataCoordinateQueryResults, recordStorage: DimensionRecordStorage)¶
- Bases: - DimensionRecordQueryResults- Implementation of DimensionRecordQueryResults using database query. - Parameters:
- dataIdsDataCoordinateQueryResults
- Iterator for DataIds. 
- recordStorageDimensionRecordStorage
- Instance of storage class for dimension records. 
 
- dataIds
 - Methods Summary - any(*[, execute, exact])- Test whether this query returns any results. - count(*[, exact])- Count the number of rows this query would return. - Return human-readable messages that may help explain why the query yields no results. - limit(limit[, offset])- Make the iterator return limited number of records. - order_by(*args)- Make the iterator return ordered result. - Methods Documentation - any(*, execute: bool = True, exact: bool = True) bool¶
- Test whether this query returns any results. - Parameters:
- executebool, optional
- If - True, execute at least a- LIMIT 1query if it cannot be determined prior to execution that the query would return no rows.
- exactbool, optional
- If - True, run the full query and perform post-query filtering if needed, until at least one result row is found. If- False, the returned result does not account for post-query filtering, and hence may be- Trueeven when all result rows would be filtered out.
 
- execute
- Returns:
 
 - count(*, exact: bool = True) int¶
- Count the number of rows this query would return. - Parameters:
- Returns:
- countint
- The number of rows the query would return, or an upper bound if - exact=False.
 
- count
 - Notes - This counts the number of rows returned, not the number of unique rows returned, so even with - exact=Trueit may provide only an upper bound on the number of deduplicated result rows.
 - explain_no_results() Iterable[str]¶
- Return human-readable messages that may help explain why the query yields no results. - Returns:
- messagesIterable[str]
- String messages that describe reasons the query might not yield any results. 
 
- messages
 - Notes - Messages related to post-query filtering are only available if the iterator has been exhausted, or if - anyor- countwas already called (with- exact=Truefor the latter two).- This method first yields messages that are generated while the query is being built or filtered, but may then proceed to diagnostics generated by performing what should be inexpensive follow-up queries. Callers can short-circuit this at any time by simply not iterating further. 
 - limit(limit: int, offset: int | None = None) DimensionRecordQueryResults¶
- Make the iterator return limited number of records. - Parameters:
- Returns:
- resultDimensionRecordQueryResults
- Returns - selfinstance which is updated to return limited set of records.
 
- result
 - Notes - This method can modify the iterator in place and return the same instance. Normally this method is used together with - order_bymethod.
 - order_by(*args: str) DimensionRecordQueryResults¶
- Make the iterator return ordered result. - Parameters:
- *argsstr
- Names of the columns/dimensions to use for ordering. Column name can be prefixed with minus ( - -) to use descending ordering.
 
- *args
- Returns:
- resultDimensionRecordQueryResults
- Returns - selfinstance which is updated to return ordered result.
 
- result
 - Notes - This method can modify the iterator in place and return the same instance.