lsst.dax.apdb ga286e2ef02+7bb24105a7
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | List of all members
lsst.dax.apdb.apdbSqlSchema.ApdbSqlSchema Class Reference
Inheritance diagram for lsst.dax.apdb.apdbSqlSchema.ApdbSqlSchema:
lsst.dax.apdb.apdbSchema.ApdbSchema

Public Member Functions

def __init__ (self, sqlalchemy.engine.Engine engine, str dia_object_index, str htm_index_column, str schema_file, str schema_name="ApdbSchema", str prefix="", Optional[str] namespace=None, bool use_insert_id=False)
 
None makeSchema (self, bool drop=False)
 
Table get_table (self, ApdbTables|ExtraTables table_enum)
 
list[Column] get_apdb_columns (self, ApdbTables|ExtraTables table_enum)
 
bool has_insert_id (self)
 
- Public Member Functions inherited from lsst.dax.apdb.apdbSchema.ApdbSchema
def __init__ (self, str schema_file, str schema_name="ApdbSchema")
 
Union[type, str] column_dtype (self, Type[felis.types.FelisType] felis_type)
 

Static Public Attributes

tuple pixel_id_tables = (ApdbTables.DiaObject, ApdbTables.DiaObjectLast, ApdbTables.DiaSource)
 

Additional Inherited Members

- Public Attributes inherited from lsst.dax.apdb.apdbSchema.ApdbSchema
 tableSchemas
 

Detailed Description

Class for management of APDB schema.

Attributes
----------
objects : `sqlalchemy.Table`
    DiaObject table instance
objects_last : `sqlalchemy.Table`
    DiaObjectLast table instance, may be None
sources : `sqlalchemy.Table`
    DiaSource table instance
forcedSources : `sqlalchemy.Table`
    DiaForcedSource table instance
has_insert_id : `bool`
    If true then schema has tables for insert ID tracking.

Parameters
----------
engine : `sqlalchemy.engine.Engine`
    SQLAlchemy engine instance
dia_object_index : `str`
    Indexing mode for DiaObject table, see `ApdbSqlConfig.dia_object_index`
    for details.
htm_index_column : `str`
    Name of a HTM index column for DiaObject and DiaSource tables.
schema_file : `str`
    Name of the YAML schema file.
schema_name : `str`, optional
    Name of the schema in YAML files.
prefix : `str`, optional
    Prefix to add to all schema elements.
namespace : `str`, optional
    Namespace (or schema name) to use for all APDB tables.
use_insert_id : `bool`, optional

Constructor & Destructor Documentation

◆ __init__()

def lsst.dax.apdb.apdbSqlSchema.ApdbSqlSchema.__init__ (   self,
sqlalchemy.engine.Engine  engine,
str  dia_object_index,
str  htm_index_column,
str  schema_file,
str   schema_name = "ApdbSchema",
str   prefix = "",
Optional[str]   namespace = None,
bool   use_insert_id = False 
)

Member Function Documentation

◆ get_apdb_columns()

list[Column] lsst.dax.apdb.apdbSqlSchema.ApdbSqlSchema.get_apdb_columns (   self,
ApdbTables | ExtraTables  table_enum 
)
Return list of columns defined for a table in APDB schema.

Returned list excludes columns that are implementation-specific, e.g.
``pixelId`` column is not include in the returned list.

Parameters
----------
table_enum : `ApdbTables` or `ExtraTables`
    Type of table.

Returns
-------
table : `list` [`sqlalchemy.schema.Column`]
    Table instance.

Raises
------
ValueError
    Raised if ``table_enum`` is not valid for this database.

◆ get_table()

Table lsst.dax.apdb.apdbSqlSchema.ApdbSqlSchema.get_table (   self,
ApdbTables | ExtraTables  table_enum 
)
Return SQLAlchemy table instance for a specified table type/enum.

Parameters
----------
table_enum : `ApdbTables` or `ExtraTables`
    Type of table to return.

Returns
-------
table : `sqlalchemy.schema.Table`
    Table instance.

Raises
------
ValueError
    Raised if ``table_enum`` is not valid for this database.

◆ has_insert_id()

bool lsst.dax.apdb.apdbSqlSchema.ApdbSqlSchema.has_insert_id (   self)
Whether insert ID tables are to be used (`bool`).

◆ makeSchema()

None lsst.dax.apdb.apdbSqlSchema.ApdbSqlSchema.makeSchema (   self,
bool   drop = False 
)
Create or re-create all tables.

Parameters
----------
drop : `bool`, optional
    If True then drop tables before creating new ones.

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