pystratum_pgsql.backend package

Submodules

pystratum_pgsql.backend.PgSqlBackend module

class pystratum_pgsql.backend.PgSqlBackend.PgSqlBackend[source]

Bases: pystratum_backend.Backend.Backend

Semi interface for PyStratum’s backends.

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_pgsql.backend.PgSqlConstantWorker module

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

Bases: pystratum_pgsql.backend.PgSqlWorker.PgSqlWorker, pystratum_common.backend.CommonConstantWorker.CommonConstantWorker

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

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

Returns the width of a field based on the data type of column.

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

pystratum_pgsql.backend.PgSqlRoutineLoaderWorker module

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

Bases: pystratum_pgsql.backend.PgSqlWorker.PgSqlWorker, pystratum_common.backend.CommonRoutineLoaderWorker.CommonRoutineLoaderWorker

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

create_routine_loader_helper(routine_name: str, pystratum_old_metadata: Optional[Dict[KT, VT]], rdbms_old_metadata: Optional[Dict[KT, VT]]) → pystratum_pgsql.helper.PgSqlRoutineLoaderHelper.PgSqlRoutineLoaderHelper[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 PostgreSQL.
Return type:

PgSqlRoutineLoaderHelper

pystratum_pgsql.backend.PgSqlRoutineWrapperGeneratorWorker module

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

Bases: pystratum_pgsql.backend.PgSqlWorker.PgSqlWorker, pystratum_common.backend.CommonRoutineWrapperGeneratorWorker.CommonRoutineWrapperGeneratorWorker

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

pystratum_pgsql.backend.PgSqlWorker module

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

Bases: object

Class for connecting to PostgreSQL instances and reading PostgreSQL specific connection parameters from configuration files.

connect() → None[source]

Connects to the PostgreSQL instance.

disconnect() → None[source]

Disconnects from the PostgreSQL instance.

Module contents