inspectomop.connection.Connection¶
- class inspectomop.connection.Connection(engine: Engine, connection: PoolProxiedConnection | None = None, _has_events: bool | None = None, _allow_revalidate: bool = True, _allow_autobegin: bool = True)¶
A subclass of sqlalchemy.engine.Connection.
The execute method returns an inspectomop.Results object that adds additional methods for retrieving query results as Pandas DataFrames.
See also
- __init__(engine: Engine, connection: PoolProxiedConnection | None = None, _has_events: bool | None = None, _allow_revalidate: bool = True, _allow_autobegin: bool = True)¶
Construct a new Connection.
Methods
__init__(engine[, connection, _has_events, ...])Construct a new Connection.
begin()Begin a transaction prior to autobegin occurring.
begin_nested()Begin a nested transaction (i.e. SAVEPOINT) and return a transaction handle that controls the scope of the SAVEPOINT.
begin_twophase([xid])Begin a two-phase or XA transaction and return a transaction handle.
close()Close this
_engine.Connection.commit()Commit the transaction that is currently in progress.
commit_prepared(xid[, recover])detach()Detach the underlying DB-API connection from its connection pool.
exec_driver_sql(statement[, parameters, ...])Executes a string SQL statement on the DBAPI cursor directly, without any SQL compilation steps.
execute(statement[, parameters, ...])Executes an SQL query on the OMOP CDM.
execution_options(...)Set non-SQL options for the connection which take effect during execution.
get_execution_options()Get the non-SQL options which will take effect during execution.
get_isolation_level()Return the current actual isolation level that's present on the database within the scope of this connection.
get_nested_transaction()Return the current nested transaction in progress, if any.
get_transaction()Return the current root transaction in progress, if any.
in_nested_transaction()Return True if a transaction is in progress.
in_transaction()Return True if a transaction is in progress.
invalidate([exception])Invalidate the underlying DBAPI connection associated with this
_engine.Connection.recover_twophase()rollback()Roll back the transaction that is currently in progress.
rollback_prepared(xid[, recover])scalar(-> ~sqlalchemy.engine.base._T | None)Executes a SQL statement construct and returns a scalar object.
scalars(-> ScalarResult[_T])Executes and returns a scalar result set, which yields scalar values from the first column of each row.
schema_for_object(obj)Return the schema name for the given schema item taking into account current schema translate map.
Attributes
closedReturn True if this connection is closed.
connectionThe underlying DB-API connection managed by this Connection.
default_isolation_levelThe initial-connection time isolation level associated with the
_engine.Dialectin use.dispatchinfoInfo dictionary associated with the underlying DBAPI connection referred to by this
_engine.Connection, allowing user-defined data to be associated with the connection.invalidatedReturn True if this connection was invalidated.
should_close_with_resultdialect