ConnectionWrapper

class felis.db.utils.ConnectionWrapper(engine)

Bases: object

Wrap a SQLAlchemy engine or mock connection to provide a consistent interface for executing SQL statements.

Parameters:

engine (Engine | MockConnection) – The SQLAlchemy engine or mock connection to wrap.

Methods Summary

execute(statement)

Execute a SQL statement on the engine and return the result.

Methods Documentation

execute(statement)

Execute a SQL statement on the engine and return the result.

Parameters:

statement (Any) – The SQL statement to execute.

Returns:

The result of the statement execution.

Return type:

sqlalchemy.engine.ResultProxy

Notes

The statement will be executed in a transaction block if not using a mock connection.