ralsei.db_actions
¶
Module Contents¶
Classes¶
Action for adding columns to a table |
|
Action for dropping columns from a table |
Functions¶
Check if table exists |
|
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
-
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