cpl_core.database.context

cpl_core.database.context.database_context

class cpl_core.database.context.database_context.DatabaseContext

Bases: DatabaseContextABC

Representation of the database context

connect(database_settings: DatabaseSettings)

Connects to a database by connection settings

property cursor: MySQLCursorBuffered
save_changes()

Saves changes of the database

select(statement: str) list[tuple]

Runs SQL Statements

statement: str

list: Fetched list of selected elements

cpl_core.database.context.database_context_abc

class cpl_core.database.context.database_context_abc.DatabaseContextABC(*args)

Bases: ABC

ABC for the cpl_core.database.context.database_context.DatabaseContext

abstract connect(database_settings: DatabaseSettings)

Connects to a database by connection settings

abstract property cursor: MySQLCursorBuffered
abstract save_changes()

Saves changes of the database

abstract select(statement: str) list[tuple]

Runs SQL Statements

statement: str

list: Fetched list of selected elements