lsst.daf.persistence  22.0.1-4-g243d05b+bb48b9f62f
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
lsst.daf.persistence.registries.PgsqlRegistry Class Reference
Inheritance diagram for lsst.daf.persistence.registries.PgsqlRegistry:
lsst.daf.persistence.registries.SqlRegistry lsst.daf.persistence.registries.Registry

Public Member Functions

def __init__ (self, location)
 
def lookup (self, *args, **kwargs)
 
def lookup (self, lookupProperties, reference, dataId, **kwargs)
 
def executeQuery (self, returnFields, joinClause, whereFields, range, values)
 

Static Public Member Functions

def readYaml (location)
 
def create (location)
 

Public Attributes

 root
 
 conn
 

Static Public Attributes

string placeHolder = "%s"
 

Detailed Description

A PostgreSQL-based registry

Definition at line 456 of file registries.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.daf.persistence.registries.PgsqlRegistry.__init__ (   self,
  location 
)
Constructor

Parameters
----------
location : `str`
    Path to PostgreSQL configuration file.

Reimplemented from lsst.daf.persistence.registries.SqlRegistry.

Definition at line 460 of file registries.py.

Member Function Documentation

◆ create()

def lsst.daf.persistence.registries.Registry.create (   location)
staticinherited
Create a registry object of an appropriate type.
@param location (string) Path or URL for registry, or None if
                         unavailable

Definition at line 71 of file registries.py.

◆ executeQuery()

def lsst.daf.persistence.registries.SqlRegistry.executeQuery (   self,
  returnFields,
  joinClause,
  whereFields,
  range,
  values 
)
inherited
Extract metadata from the registry.
@param returnFields (list of strings) Metadata fields to be extracted.
@param joinClause   (list of strings) Tables in which metadata fields
                    are located.
@param whereFields  (list of tuples) First tuple element is metadata
                    field to query; second is the value that field
                    must have (often '?').
@param range        (tuple) Value, lower limit, and upper limit for a
                    range condition on the metadata.  Any of these can
                    be metadata fields.
@param values       (tuple) Tuple of values to be substituted for '?'
                    characters in the whereFields values or the range
                    values.
@return (list of tuples) All sets of field values that meet the
        criteria

Definition at line 401 of file registries.py.

◆ lookup() [1/2]

def lsst.daf.persistence.registries.PgsqlRegistry.lookup (   self,
args,
**  kwargs 
)

Definition at line 525 of file registries.py.

◆ lookup() [2/2]

def lsst.daf.persistence.registries.SqlRegistry.lookup (   self,
  lookupProperties,
  reference,
  dataId,
**  kwargs 
)
inherited
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 a key/value iterable. Keys must be string.
If value is a string then will look for elements in the repository that match value for value.
If value is a 2-item iterable then will look for elements in the repository where the value is between
the values of value[0] and value[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 370 of file registries.py.

◆ readYaml()

def lsst.daf.persistence.registries.PgsqlRegistry.readYaml (   location)
static
Read YAML configuration file

The YAML configuration file should contain:
* host : host name for database connection
* port : port for database connection
* user : user name for database connection
* database : database name

It may also contain:
* password : password for database connection

The optional entries are set to `None` in the output configuration.

Parameters
----------
location : `str`
    Path to PostgreSQL YAML config file.

Returns
-------
config : `dict`
    Configuration

Definition at line 478 of file registries.py.

Member Data Documentation

◆ conn

lsst.daf.persistence.registries.SqlRegistry.conn
inherited

Definition at line 313 of file registries.py.

◆ placeHolder

string lsst.daf.persistence.registries.PgsqlRegistry.placeHolder = "%s"
static

Definition at line 458 of file registries.py.

◆ root

lsst.daf.persistence.registries.PgsqlRegistry.root

Definition at line 474 of file registries.py.


The documentation for this class was generated from the following file: