Column#
- class ormstorm.orm.column.Column(type: str, not_null: bool = False, default: object | None = None, autoincrement: bool = False, unique: bool = False, primary_key: bool = False, check: str | None = None)#
Standard class for creating a column object.
- Parameters:
type – Data type
not_null – Causes the column to not be NULL
default – Sets the default value for the insert
autoincrement – Causes a unique number to be generated automatically
unique – Ensures that all values in a column are distinct
primary_key – Uniquely identifies each entry in a table
check – Used to limit the range of values that can be placed in a column
Usage#
The column takes one single mandatory type
argument. You can take the column type from the Types namespace.
column = Column(
Types.STRING, ...
)
Adding a column is currently possible only when creating a table.
class YourTable(Table):
...
column = Column(...)