cpl_core.database.context package

Submodules

cpl_core.database.context.database_context module

class cpl_core.database.context.database_context.DatabaseContext

Bases: DatabaseContextABC

Representation of the database context

Parameter:

database_settings: cpl_core.database.database_settings.DatabaseSettings

connect(database_settings: DatabaseSettings)

Connects to a database by connection settings

Parameter:

database_settings cpl_core.database.database_settings.DatabaseSettings

property cursor: MySQLCursorBuffered
save_changes()

Saves changes of the database

select(statement: str) list[tuple]

Runs SQL Statements

Parameter:

statement: str

Returns:

list: Fetched list of selected elements

cpl_core.database.context.database_context_abc module

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

Parameter:

database_settings cpl_core.database.database_settings.DatabaseSettings

abstract property cursor: MySQLCursorBuffered
abstract save_changes()

Saves changes of the database

abstract select(statement: str) list[tuple]

Runs SQL Statements

Parameter:

statement: str

Returns:

list: Fetched list of selected elements

Module contents

cpl-core CPL core

CPL core package

copyright:
  1. 2020 - 2023 sh-edraft.de

license:

MIT, see LICENSE for more details.

class cpl_core.database.context.VersionInfo(major, minor, micro)

Bases: tuple

major

Alias for field number 0

micro

Alias for field number 2

minor

Alias for field number 1