A base class for SQL-based registries
Subclasses should define the class variable `placeHolder` (the particular
placeholder to use for parameter substitution) appropriately. The
database's python module should define `paramstyle` (see PEP 249), which
would indicate what to use for a placeholder:
* paramstyle = "qmark" --> placeHolder = "?"
* paramstyle = "format" --> placeHolder = "%s"
Other `paramstyle` values are not currently supported.
Constructor parameters
----------------------
conn : DBAPI connection object
Connection object
Definition at line 289 of file registries.py.
def lsst.daf.persistence.registries.SqlRegistry.lookup |
( |
|
self, |
|
|
|
lookupProperties, |
|
|
|
reference, |
|
|
|
dataId, |
|
|
|
kwargs |
|
) |
| |
Perform a lookup in the registry.
Return values are refined by the values in dataId.
Returns a list of values that match keys in lookupProperties.
e.g. if the template is 'raw/raw_v%(visit)d_f%(filter)s.fits.gz', and
dataId={'visit':1}, and lookupProperties is ['filter'], and the
filesystem under self.root has exactly one file 'raw/raw_v1_fg.fits.gz'
then the return value will be [('g',)]
:param lookupProperties:
:param dataId: must be an iterable. Keys must be string.
If key is a string then will look for elements in the repository that match value for key.
If key is a 2-item iterable then will look for elements in the repository where the value is between
the values of key[0] and key[1].
:param reference: other data types that may be used to search for values.
:param **kwargs: nothing needed for sqlite lookup
:return: a list of values that match keys in lookupProperties.
Definition at line 322 of file registries.py.