pystratum_mysql.backend package

Submodules

pystratum_mysql.backend.MySqlBackend module

class pystratum_mysql.backend.MySqlBackend.MySqlBackend[source]

Bases: pystratum_backend.Backend.Backend

PyStratum Backend for MySQL & MariaDB.

create_constant_worker(config: configparser.ConfigParser, io: pystratum_backend.StratumStyle.StratumStyle) → Optional[pystratum_backend.ConstantWorker.ConstantWorker][source]

Creates the object that does the actual execution of the constant command for the backend.

Parameters:
  • config (ConfigParser) – The settings from the PyStratum configuration file.
  • io (StratumStyle) – The output object.
Return type:

ConstantWorker|None

create_routine_loader_worker(config: configparser.ConfigParser, io: pystratum_backend.StratumStyle.StratumStyle) → Optional[pystratum_backend.RoutineLoaderWorker.RoutineLoaderWorker][source]

Creates the object that does the actual execution of the routine loader command for the backend.

Parameters:
  • config (ConfigParser) – The settings from the PyStratum configuration file.
  • io (StratumStyle) – The output object.
Return type:

RoutineLoaderWorker|None

create_routine_wrapper_generator_worker(config: configparser.ConfigParser, io: pystratum_backend.StratumStyle.StratumStyle) → Optional[pystratum_backend.RoutineWrapperGeneratorWorker.RoutineWrapperGeneratorWorker][source]

Creates the object that does the actual execution of the routine wrapper generator command for the backend.

Parameters:
  • config (ConfigParser) – The settings from the PyStratum configuration file.
  • io (StratumStyle) – The output object.
Return type:

RoutineWrapperGeneratorWorker|None

pystratum_mysql.backend.MySqlConstantWorker module

class pystratum_mysql.backend.MySqlConstantWorker.MySqlConstantWorker(io: pystratum_backend.StratumStyle.StratumStyle, config: configparser.ConfigParser)[source]

Bases: pystratum_mysql.backend.MySqlWorker.MySqlWorker, pystratum_common.backend.CommonConstantWorker.CommonConstantWorker

Class for creating constants based on column widths, and auto increment columns and labels for MySQL databases.

static derive_field_length(column: Dict[str, Any]) → Optional[int][source]

Returns the width of a field based on column.

Parameters:column (dict) – The column of which the field is based.
Return type:int|None

pystratum_mysql.backend.MySqlRoutineLoaderWorker module

class pystratum_mysql.backend.MySqlRoutineLoaderWorker.MySqlRoutineLoaderWorker(io: pystratum_backend.StratumStyle.StratumStyle, config: configparser.ConfigParser)[source]

Bases: pystratum_mysql.backend.MySqlWorker.MySqlWorker, pystratum_common.backend.CommonRoutineLoaderWorker.CommonRoutineLoaderWorker

Class for loading stored routines into a MySQL instance from (pseudo) SQL files.

MAX_LENGTH_BINARY = 255

Maximum length of a varbinary.

MAX_LENGTH_CHAR = 255

Maximum length of a varchar.

MAX_LENGTH_VARBINARY = 4096

Maximum length of a varbinary.

MAX_LENGTH_VARCHAR = 4096

Maximum length of a varchar.

create_routine_loader_helper(routine_name: str, pystratum_old_metadata: Optional[Dict[KT, VT]], rdbms_old_metadata: Optional[Dict[KT, VT]]) → pystratum_mysql.helper.MySqlRoutineLoaderHelper.MySqlRoutineLoaderHelper[source]

Creates a Routine Loader Helper object.

Parameters:
  • routine_name (str) – The name of the routine.
  • pystratum_old_metadata (dict) – The old metadata of the stored routine from PyStratum.
  • rdbms_old_metadata (dict) – The old metadata of the stored routine from MySQL.
Return type:

MySqlRoutineLoaderHelper

pystratum_mysql.backend.MySqlRoutineWrapperGeneratorWorker module

class pystratum_mysql.backend.MySqlRoutineWrapperGeneratorWorker.MySqlRoutineWrapperGeneratorWorker(io: pystratum_backend.StratumStyle.StratumStyle, config: configparser.ConfigParser)[source]

Bases: pystratum_mysql.backend.MySqlWorker.MySqlWorker, pystratum_common.backend.CommonRoutineWrapperGeneratorWorker.CommonRoutineWrapperGeneratorWorker

Class for generating a class with wrapper methods for calling stored routines in a MySQL database.

pystratum_mysql.backend.MySqlWorker module

class pystratum_mysql.backend.MySqlWorker.MySqlWorker(io: pystratum_backend.StratumStyle.StratumStyle, config: configparser.ConfigParser)[source]

Bases: object

connect() → None[source]

Connects to the database.

disconnect() → None[source]

Disconnects from the database.

Module contents