ralsei.types.value_column

Module Contents

Classes

ValueColumnBase

Column and its associated value, base class for ValueColumn and ValueColumnRendered

ValueColumn

Column template class with an associated value

ValueColumnRendered

Rendered column class with an associated value

ValueColumnSetStatement

Renders to name = value, for use in UPDATE statements

IdColumn

Column name and its associated value, used inside a WHERE clause for locating a row

API

class ralsei.types.value_column.ValueColumnBase(name: str, value: Any = FROM_NAME)

Bases: ralsei.types.column.ColumnBase

Column and its associated value, base class for ValueColumn and ValueColumnRendered

Parameters:
name: str

column name

value: Any = FROM_NAME

value that will be applied to the column

By default, will be set to a ralsei.types.Placeholder with the same name as the column

Initialization

value : Any = None
property set_statement : ralsei.types.value_column.ValueColumnSetStatement

As set statement (name = value)

abstract render(env: ralsei.jinja.ISqlEnvironment, /, **params: Any) ralsei.types.value_column.ValueColumnRendered

Turn into the rendered version

class ralsei.types.value_column.ValueColumn(name: str, type: str, value: Any = FROM_NAME)

Bases: ralsei.types.column.Column, ralsei.types.value_column.ValueColumnBase

Column template class with an associated value

Parameters:
name: str

column name

type: str

jinja template of the column type, like INT REFERENCES {{other}}(id)

value: Any = FROM_NAME

value that will be applied to the column

By default, will be set to a ralsei.types.Placeholder with the same name as the column

Initialization

render(env: ralsei.jinja.ISqlEnvironment, /, **params: Any) ralsei.types.value_column.ValueColumnRendered

Render the type template

class ralsei.types.value_column.ValueColumnRendered(name: str, type: str, value: Any = FROM_NAME)

Bases: ralsei.types.column.ColumnRendered, ralsei.types.value_column.ValueColumnBase

Rendered column class with an associated value

Parameters:
name: str

column name

type: str

column type as raw sql string, like INT REFERENCES "other"(id)

value: Any = FROM_NAME

value that will be applied to the column

By default, will be set to a ralsei.types.Placeholder with the same name as the column

Initialization

render(env: ralsei.jinja.ISqlEnvironment, /, **params: Any) ralsei.types.value_column.ValueColumnRendered
class ralsei.types.value_column.ValueColumnSetStatement(value_column: ralsei.types.value_column.ValueColumnBase)

Bases: ralsei.types.to_sql.ToSql

Renders to name = value, for use in UPDATE statements

Initialization

value_column : ralsei.types.value_column.ValueColumnBase = None
to_sql(env: ralsei.jinja.ISqlEnvironment) str
class ralsei.types.value_column.IdColumn(name: str, value: Any = FROM_NAME)

Bases: ralsei.types.to_sql.ToSql

Column name and its associated value, used inside a WHERE clause for locating a row

Renders to name = value

Parameters:
name: str

column name

value: Any = FROM_NAME

value that uniquely identifies a row

By default, will be set to a ralsei.types.Placeholder with the same name as the column

Initialization

name : str = None
value : Any = None
property identifier : ralsei.types.primitives.Identifier

name wrapped in a SQL identifier

to_sql(env: ralsei.jinja.ISqlEnvironment) str