OpaqueTableStorage¶
- class lsst.daf.butler.registry.interfaces.OpaqueTableStorage(name: str)¶
Bases:
ABC
An interface that manages the records associated with a particular opaque table in a
Registry
.- Parameters:
- name
str
Name of the opaque table.
- name
Methods Summary
delete
(columns, *rows)Remove records from an opaque table.
ensure
(*data[, transaction])Insert records into the table, skipping rows that already exist.
fetch
(**where)Retrieve records from an opaque table.
insert
(*data[, transaction])Insert records into the table.
replace
(*data[, transaction])Insert records into the table, replacing if previously existing but different.
Methods Documentation
- abstract delete(columns: Iterable[str], *rows: dict) None ¶
Remove records from an opaque table.
- Parameters:
- columns
Iterable
ofstr
The names of columns that will be used to constrain the rows to be deleted; these will be combined via
AND
to form theWHERE
clause of the delete query.- *rows
Positional arguments are the keys of rows to be deleted, as dictionaries mapping column name to value. The keys in all dictionaries must be exactly the names in
columns
.
- columns
- abstract ensure(*data: dict, transaction: DatastoreTransaction | None = None) None ¶
Insert records into the table, skipping rows that already exist.
- Parameters:
- *data
Each additional positional argument is a dictionary that represents a single row to be added.
- transaction
DatastoreTransaction
, optional Transaction object that can be used to enable an explicit rollback of the insert to be registered. Can be ignored if rollback is handled via a different mechanism, such as by a database. Can be
None
if no external transaction is available.
- abstract fetch(**where: Any) Iterator[Mapping[Any, Any]] ¶
Retrieve records from an opaque table.
- Parameters:
- **where
Additional keyword arguments are interpreted as equality constraints that restrict the returned rows (combined with AND); keyword arguments are column names and values are the values they must have.
- Yields:
- row
dict
A dictionary representing a single result row.
- row
- abstract insert(*data: dict, transaction: DatastoreTransaction | None = None) None ¶
Insert records into the table.
- Parameters:
- *data
Each additional positional argument is a dictionary that represents a single row to be added.
- transaction
DatastoreTransaction
, optional Transaction object that can be used to enable an explicit rollback of the insert to be registered. Can be ignored if rollback is handled via a different mechanism, such as by a database. Can be
None
if no external transaction is available.
- abstract replace(*data: dict, transaction: DatastoreTransaction | None = None) None ¶
Insert records into the table, replacing if previously existing but different.
- Parameters:
- *data
Each additional positional argument is a dictionary that represents a single row to be added.
- transaction
DatastoreTransaction
, optional Transaction object that can be used to enable an explicit rollback of the insert to be registered. Can be ignored if rollback is handled via a different mechanism, such as by a database. Can be
None
if no external transaction is available.