deev.utils#

begin_transaction(dbcontext_or_connectionstring)#
Return type:

DbTransactionContext

connect(connectionstring, *, connect_timeout=3, command_timeout=9)#

Create a PEP 249 Connection to a database, given connectionstring.

Return type:

DbConnection

Args:

connectionstring: A DSN string or ConnectionString object. connect_timeout: Connection timeout in seconds (if the provider supports it).

Only used when connectionstring does not specify Connection Timeout.

command_timeout: Command/operation timeout in seconds (if the provider supports it).

Only used when connectionstring does not specify Command Timeout.

create_database(connectionstring)#

Create a database if it does not yet exist.

Return type:

None

create_table_adapter(entity_type, dbcontext_or_connectionstring, *, create_table=False, table_name=None)#
Return type:

DbTableAdapter[Any]

apply_migrations(connectionstring, migrations_path, stop_at=None)#
Return type:

None

undo_migrations(connectionstring, migrations_path, stop_at=None)#
Return type:

None