LSST Applications g0265f82a02+d6b5cd48b5,g02d81e74bb+80768bd682,g04242d3e92+8eaa23c173,g06b2ea86fd+734f9505a2,g2079a07aa2+14824f138e,g212a7c68fe+5f4fc2ea00,g2305ad1205+293ab1327e,g2bbee38e9b+d6b5cd48b5,g337abbeb29+d6b5cd48b5,g3ddfee87b4+8eaa23c173,g487adcacf7+abec5a19c5,g50ff169b8f+5929b3527e,g52b1c1532d+a6fc98d2e7,g591dd9f2cf+97ef3b4495,g5a732f18d5+66d966b544,g5d7b63bc56+636c3c3fd8,g64a986408d+80768bd682,g858d7b2824+80768bd682,g8a8a8dda67+a6fc98d2e7,g99cad8db69+6282a5f541,g9ddcbc5298+d4bad12328,ga1e77700b3+246acaaf9c,ga8c6da7877+9e3c062e8e,gb0e22166c9+3863383f4c,gb6a65358fc+d6b5cd48b5,gba4ed39666+9664299f35,gbb8dafda3b+60f904e7bc,gc120e1dc64+1bf26d0180,gc28159a63d+d6b5cd48b5,gcf0d15dbbd+8eaa23c173,gd2a12a3803+f8351bc914,gdaeeff99f8+a38ce5ea23,ge79ae78c31+d6b5cd48b5,gee10cc3b42+a6fc98d2e7,gf1cff7945b+80768bd682,v24.1.5.rc1
LSST Data Management Base Package
|
Public Member Functions | |
__init__ (self, sqlalchemy.engine.Engine engine, str dia_object_index, str htm_index_column, str schema_file, str schema_name="ApdbSchema", str prefix="", str|None namespace=None, bool use_insert_id=False) | |
bool | empty (self) |
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) |
Static Public Attributes | |
tuple | pixel_id_tables = (ApdbTables.DiaObject, ApdbTables.DiaObjectLast, ApdbTables.DiaSource) |
Protected Member Functions | |
bool | _check_insert_id (self) |
Mapping[ApdbTables, Table] | _make_apdb_tables (self, str mysql_engine="InnoDB") |
Mapping[ExtraTables, Table] | _make_extra_tables (self, Mapping[ApdbTables, Table] apdb_tables, str mysql_engine="InnoDB") |
list[Column] | _tableColumns (self, ApdbTables table_name) |
list[sqlalchemy.schema.SchemaItem] | _tableIndices (self, ApdbTables table_name) |
list[Column] | _insertIdColumns (self, ExtraTables table_enum) |
list[Column] | _tablePkColumns (self, ApdbTables table_enum) |
list[sqlalchemy.schema.SchemaItem] | _insertIdIndices (self, ExtraTables table_enum, sqlalchemy.schema.Table apdb_table, sqlalchemy.schema.Table parent_table) |
type|sqlalchemy.types.TypeEngine | _getDoubleType (cls, sqlalchemy.engine.Engine engine) |
Protected Attributes | |
_engine | |
_dia_object_index | |
_htm_index_column | |
_prefix | |
_use_insert_id | |
_metadata | |
_type_map | |
_apdb_tables | |
_extra_tables | |
_has_insert_id | |
_metadata_check | |
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
Definition at line 146 of file apdbSqlSchema.py.
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 = "", | ||
str | None | namespace = None, | ||
bool | use_insert_id = False ) |
Reimplemented from lsst.dax.apdb.apdbSchema.ApdbSchema.
Definition at line 186 of file apdbSqlSchema.py.
|
protected |
Check whether database has tables for tracking insert IDs.
Definition at line 396 of file apdbSqlSchema.py.
|
protected |
DOUBLE type is database-specific, select one based on dialect. Parameters ---------- engine : `sqlalchemy.engine.Engine` Database engine. Returns ------- type_object : `object` Database-specific type definition.
Definition at line 585 of file apdbSqlSchema.py.
|
protected |
Return list of columns for insert ID tables.
Definition at line 532 of file apdbSqlSchema.py.
|
protected |
Return set of constraints/indices for insert ID tables.
Definition at line 551 of file apdbSqlSchema.py.
|
protected |
Generate schema for regular tables. Parameters ---------- mysql_engine : `str`, optional MySQL engine type to use for new tables.
Definition at line 402 of file apdbSqlSchema.py.
|
protected |
Generate schema for insert ID tables.
Definition at line 431 of file apdbSqlSchema.py.
|
protected |
Return set of columns in a table Parameters ---------- table_name : `ApdbTables` Name of the table. Returns ------- column_defs : `list` List of `Column` objects.
Definition at line 467 of file apdbSqlSchema.py.
|
protected |
Return set of constraints/indices in a table Parameters ---------- table_name : `ApdbTables` Name of the table. info : `dict` Additional options passed to SQLAlchemy index constructor. Returns ------- index_defs : `list` List of SQLAlchemy index/constraint objects.
Definition at line 497 of file apdbSqlSchema.py.
|
protected |
Return a list of columns for table PK.
Definition at line 542 of file apdbSqlSchema.py.
bool lsst.dax.apdb.apdbSqlSchema.ApdbSqlSchema.empty | ( | self | ) |
Return True if database schema is empty. Returns ------- empty : `bool` `True` if none of the required APDB tables exist in the database, `False` if all required tables exist. Raises ------ InconsistentSchemaError Raised when some of the required tables exist but not all.
Definition at line 260 of file apdbSqlSchema.py.
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.
Definition at line 362 of file apdbSqlSchema.py.
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.
Definition at line 324 of file apdbSqlSchema.py.
bool lsst.dax.apdb.apdbSqlSchema.ApdbSqlSchema.has_insert_id | ( | self | ) |
Whether insert ID tables are to be used (`bool`).
Definition at line 390 of file apdbSqlSchema.py.
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.
Definition at line 295 of file apdbSqlSchema.py.
|
protected |
Definition at line 254 of file apdbSqlSchema.py.
|
protected |
Definition at line 200 of file apdbSqlSchema.py.
|
protected |
Definition at line 199 of file apdbSqlSchema.py.
|
protected |
Definition at line 255 of file apdbSqlSchema.py.
|
protected |
Definition at line 321 of file apdbSqlSchema.py.
|
protected |
Definition at line 201 of file apdbSqlSchema.py.
|
protected |
Definition at line 205 of file apdbSqlSchema.py.
|
protected |
Definition at line 322 of file apdbSqlSchema.py.
|
protected |
Definition at line 202 of file apdbSqlSchema.py.
|
protected |
Definition at line 208 of file apdbSqlSchema.py.
|
protected |
Definition at line 203 of file apdbSqlSchema.py.
|
static |
Definition at line 183 of file apdbSqlSchema.py.