ralsei.db_actions

Module Contents

Classes

AddColumns

Action for adding columns to a table

DropColumns

Action for dropping columns from a table

Functions

table_exists

Check if table exists

columns_exist

Check if all columns exist on a table

API

ralsei.db_actions.table_exists(conn: ralsei.connection.ConnectionEnvironment, table: ralsei.types.Table) bool

Check if table exists

ralsei.db_actions.columns_exist(conn: ralsei.connection.ConnectionEnvironment, table: ralsei.types.Table, columns: collections.abc.Iterable[str]) bool

Check if all columns exist on a table

class ralsei.db_actions.AddColumns(env: ralsei.jinja.ISqlEnvironment, table: ralsei.types.Table, columns: collections.abc.Iterable[ralsei.types.ColumnRendered], if_not_exists: bool = False)

Action for adding columns to a table

Parameters:
env: ralsei.jinja.ISqlEnvironment

jinja environment

table: ralsei.types.Table

target table

columns: collections.abc.Iterable[ralsei.types.ColumnRendered]

columns to add

if_not_exists: bool = False

use IF NOT EXISTS check

Initialization

__call__(conn: ralsei.connection.ConnectionEnvironment)

Execute action

__str__() str
class ralsei.db_actions.DropColumns(env: ralsei.jinja.ISqlEnvironment, table: ralsei.types.Table, columns: collections.abc.Iterable[ralsei.types.ColumnRendered], if_exists: bool = False)

Action for dropping columns from a table

Parameters:
env: ralsei.jinja.ISqlEnvironment

jinja environment

table: ralsei.types.Table

target table

columns: collections.abc.Iterable[ralsei.types.ColumnRendered]

columns to drop

if_exists: bool = False

use IF EXISTS check

Initialization

__call__(conn: ralsei.connection.ConnectionEnvironment)

Execute action

__str__() str