Coverage for python/lsst/daf/butler/registry/opaque.py : 98%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# This file is part of daf_butler. # # Developed for the LSST Data Management System. # This product includes software developed by the LSST Project # (http://www.lsst.org). # See the COPYRIGHT file at the top-level directory of this distribution # for details of code ownership. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. """The default concrete implementations of the classes that manage opaque tables for `Registry`. """
Any, ClassVar, Iterator, Optional, )
"""An implementation of `OpaqueTableStorage` that simply creates a true table for each different named opaque logical table.
A `ByNameOpaqueTableStorageManager` instance should always be used to construct and manage instances of this class.
Parameters ---------- db : `Database` Database engine interface for the namespace in which this table lives. name : `str` Name of the logical table (also used as the name of the actual table). table : `sqlalchemy.schema.Table` SQLAlchemy representation of the table, which must have already been created in the namespace managed by ``db`` (this is the responsibility of `ByNameOpaqueTableStorageManager`). """
# Docstring inherited from OpaqueTableStorage.
# Docstring inherited from OpaqueTableStorage. sqlalchemy.sql.and_(*[self._table.columns[k] == v for k, v in where.items()]) )
# Docstring inherited from OpaqueTableStorage.
"""An implementation of `OpaqueTableStorageManager` that simply creates a true table for each different named opaque logical table.
Instances of this class should generally be constructed via the `initialize` class method instead of invoking ``__init__`` directly.
Parameters ---------- db : `Database` Database engine interface for the namespace in which this table lives. metaTable : `sqlalchemy.schema.Table` SQLAlchemy representation of the table that records which opaque logical tables exist. """
fields=[ FieldSpec("table_name", dtype=sqlalchemy.String, length=128, primaryKey=True), ], )
def initialize(cls, db: Database, context: StaticTablesContext) -> OpaqueTableStorageManager: # Docstring inherited from OpaqueTableStorageManager.
# Docstring inherited from OpaqueTableStorageManager.
# Docstring inherited from OpaqueTableStorageManager. # Create the table itself. If it already exists but wasn't in # the dict because it was added by another client since this one # was initialized, that's fine. # Add a row to the meta table so we can find this table in the # future. Also okay if that already exists, so we use sync. |