DatabaseDimensionRecordQueryResults¶
- class lsst.daf.butler.registry.queries.DatabaseDimensionRecordQueryResults(query: Query, element: DimensionElement)¶
- Bases: - DimensionRecordQueryResults- Implementation of DimensionRecordQueryResults using database query. - Parameters:
- queryQuery
- Query object that backs this class. 
- elementDimensionElement
- Element whose records this object returns. 
 
- query
 - Notes - The - Queryclass now implements essentially all of this class’s functionality; “QueryResult” classes like this one now exist only to provide interface backwards compatibility and more specific iterator types.- Attributes Summary - Methods Summary - any(*[, execute, exact])- Test whether this query returns any results. - count(*[, exact, discard])- Count the number of rows this query would return. - explain_no_results([execute])- 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 results. - run()- Attributes Documentation - element¶
 - 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, discard: bool = False) int¶
- Count the number of rows this query would return. - Parameters:
- exactbool, optional
- If - True, run the full query and perform post-query filtering if needed to account for that filtering in the count. If- False, the result may be an upper bound.
- discardbool, optional
- If - True, compute the exact count even if it would require running the full query and then throwing away the result rows after counting them. If- False, this is an error, as the user would usually be better off executing the query first to fetch its rows into a new query (or passing- exact=False). Ignored if- exact=False.
 
- exact
- 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(execute: bool = True) Iterable[str]¶
- Return human-readable messages that may help explain why the query yields no results. 
 - limit(limit: int, offset: int | None | ellipsis = Ellipsis) Self¶
- Make the iterator return limited number of records. - Parameters:
- Returns:
- resulttyping.Self
- Returns - selfinstance which is updated to return limited set of records.
 
- result
 - Notes - This method modifies the iterator in place and returns the same instance to support method chaining. Normally this method is used together with - order_bymethod.
 - order_by(*args: str) Self¶
- Make the iterator return ordered results. - Parameters:
- *argsstr
- Names of the columns/dimensions to use for ordering. Column name can be prefixed with minus ( - -) to use descending ordering.
 
- *args
- Returns:
- resulttyping.Self
- Returns - selfinstance which is updated to return ordered result.
 
- result
 - Notes - This method modifies the iterator in place and returns the same instance to support method chaining.