# cpl_core.database.context

## cpl_core.database.context.database_context

class `cpl_core.database.context.database_context.``DatabaseContext`

  Bases: `cpl_core.database.context.database_context_abc.DatabaseContextABC`

  Representation of the database context

  > database_settings: `cpl_core.database.database_settings.DatabaseSettings`

  `connect`(database_settings: cpl_core.database.database_settings.DatabaseSettings)

    Connects to a database by connection settings

    > database_settings `cpl_core.database.database_settings.DatabaseSettings`

  property `cursor`
  `save_changes`()

    Saves changes of the database

  `select`(statement: str) → list

    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`

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

  abstract `connect`(database_settings: cpl_core.database.database_settings.DatabaseSettings)

    Connects to a database by connection settings

    > database_settings `cpl_core.database.database_settings.DatabaseSettings`

  property `cursor`
  abstract `save_changes`()

    Saves changes of the database

  abstract `select`(statement: str) → list

    Runs SQL Statements

    > statement: `str`

    > list: Fetched list of selected elements