Skip to content

Complete column type catalog

The catalog contains 40 Column factories for 39 logical types, including the id shortcut. Every factory is also available on Blueprint and returns a concrete ColumnDefinition; construction executes no SQL. ORM classes are imported from orionis.orm. The 35 types with a builder can translate to SQL, while four markers have no compilation support and are explicitly identified at the end.

The first name in each factory is the SQL column name and is required, except for id(name=“id”). The asterisk marks keyword only arguments. ORM constructors do not take that column name: the metaclass reads it from the declared attribute. Every definition supports column modifiers. Initial state is NOT NULL with no index, uniqueness, autoincrement, or default; id enables both a primary key and generation.

DDL fragments were checked by compiling the example definitions using the installed SQLite, MySQL, PostgreSQL, SQL Server, and Oracle dialects. Compilation does not certify server acceptance: strict types such as CLOB, BINARY, NCHAR, and TIMESTAMP retain backend specific meanings. Redshift requires its extra; see drivers for its restrictions.

SQL fragments below come from a separate probe declaration: sample, with length=80 for String/Unicode/VARCHAR/NVARCHAR, 2 for CHAR/NCHAR, 16 for BINARY, 64 for VARBINARY, and precision=12/scale=2 for decimals. Remaining options use defaults, including timezone=False. Usage examples may choose different values.

ParameterEffect
lengthDeclared text or binary length; does not validate HTTP payloads. None leaves backend defaults.
collationColumn collation; must exist on the selected database.
precision / scaleTotal and fractional digits in Numeric/StrictDecimal. Float precision has dialect specific semantics.
asdecimalRequests Decimal rather than float for numeric results; does not turn approximate storage into exact storage.
decimal_return_scaleScale used when converting approximate results to Decimal.
timezoneRequests timezone support; does not provide universal timezone conversion.
create_constraint / constraint_nameCreation and naming of emulated boolean/enum CHECK constraints. Constructors use name.
native_enum / validate_stringsNative ENUM selection and string validation through its processor.
native / second_precision / day_precisionINTERVAL representation and precision.
as_uuid / native_uuidUUID objects and native representation where available.
none_as_nullDistinguishes JSON null from SQL NULL for None values.

Column.id(name: str='id') -> BigInteger
BigInteger()

Use this for an automatically generated integer primary key. It is BigInteger with primary and autoIncrement already enabled; do not add another primaryKey. SQLite receives INTEGER to preserve ROWID. Oracle receives Identity, SQL Server receives IDENTITY, and Redshift needs its dialect and cannot automatically return the generated key.

from orionis.database.schema.blueprint import Blueprint
from orionis.orm import BigInteger
table = Blueprint()
column = table.id()
model_column = BigInteger().primary().autoIncrement()

The factory returns BigInteger; the constructor returns a new instance of that type. Both inherit ColumnDefinition.

DDL from the probe declaration: sqlite: INTEGER NOT NULL; mysql: BIGINT NOT NULL AUTO_INCREMENT; pgsql: BIGSERIAL NOT NULL; sqlserver: BIGINT NOT NULL IDENTITY; oracle: NUMBER(19) GENERATED BY DEFAULT AS IDENTITY.

Column.integer(name: str) -> Integer
Integer()

Use for integer counters and keys. This adds no primary key, automatic generation, or unsigned constraint. Ranges and overflow are controlled by the database.

from orionis.database.schema.blueprint import Blueprint
from orionis.orm import Integer
table = Blueprint()
column = table.integer("quantity")
model_column = Integer()

The factory returns Integer; the constructor returns a new instance of that type. Both inherit ColumnDefinition.

DDL from the probe declaration: sqlite: INTEGER NOT NULL; mysql: INTEGER NOT NULL; pgsql: INTEGER NOT NULL; sqlserver: INTEGER NOT NULL; oracle: INTEGER NOT NULL.

Column.bigInteger(name: str) -> BigInteger
BigInteger()

Use for external identifiers and large counters. Without primary and autoIncrement this is an ordinary column and generates no values.

from orionis.database.schema.blueprint import Blueprint
from orionis.orm import BigInteger
table = Blueprint()
column = table.bigInteger("external_id")
model_column = BigInteger()

The factory returns BigInteger; the constructor returns a new instance of that type. Both inherit ColumnDefinition.

DDL from the probe declaration: sqlite: BIGINT NOT NULL; mysql: BIGINT NOT NULL; pgsql: BIGINT NOT NULL; sqlserver: BIGINT NOT NULL; oracle: NUMBER(19) NOT NULL.

Column.smallInteger(name: str) -> SmallInteger
SmallInteger()

Use for numeric states and small quantities. The database enforces the narrower range; SQLite does not guarantee SMALLINT limits.

from orionis.database.schema.blueprint import Blueprint
from orionis.orm import SmallInteger
table = Blueprint()
column = table.smallInteger("priority")
model_column = SmallInteger()

The factory returns SmallInteger; the constructor returns a new instance of that type. Both inherit ColumnDefinition.

DDL from the probe declaration: sqlite: SMALLINT NOT NULL; mysql: SMALLINT NOT NULL; pgsql: SMALLINT NOT NULL; sqlserver: SMALLINT NOT NULL; oracle: SMALLINT NOT NULL.

Column.boolean(name: str, *, create_constraint: bool=False, constraint_name: str | None=None) -> Boolean
Boolean(*, create_constraint: bool=False, name: str | None=None)

Use for True/False flags. create_constraint=False adds no 0/1 CHECK when the backend emulates booleans; enable it when required. The constructor names that CHECK with name, while the factory uses constraint_name.

from orionis.database.schema.blueprint import Blueprint
from orionis.orm import Boolean
table = Blueprint()
column = table.boolean("active", create_constraint=True, constraint_name="ck_active")
model_column = Boolean(create_constraint=True, name="ck_active")

The factory returns Boolean; the constructor returns a new instance of that type. Both inherit ColumnDefinition.

DDL from the probe declaration: sqlite: BOOLEAN NOT NULL; mysql: BOOL NOT NULL; pgsql: BOOLEAN NOT NULL; sqlserver: BIT NOT NULL; oracle: BOOLEAN NOT NULL.

Column.numeric(name: str, precision: int | None=None, scale: int | None=None, decimal_return_scale: int | None=None, *, asdecimal: bool=True) -> Numeric
Numeric(precision: int | None=None, scale: int | None=None, decimal_return_scale: int | None=None, *, asdecimal: bool=True)

Use for money and values requiring Decimal. precision counts all digits and scale counts fractional digits. When either is supplied, both must be integers with precision>0 and 0<=scale<=precision, otherwise ValueError is raised. asdecimal=True requests Decimal, subject to the driver.

from orionis.database.schema.blueprint import Blueprint
from orionis.orm import Numeric
table = Blueprint()
column = table.numeric("amount", 12, 2)
model_column = Numeric(12, 2)

The factory returns Numeric; the constructor returns a new instance of that type. Both inherit ColumnDefinition.

DDL from the probe declaration: sqlite: NUMERIC(12, 2) NOT NULL; mysql: NUMERIC(12, 2) NOT NULL; pgsql: NUMERIC(12, 2) NOT NULL; sqlserver: NUMERIC(12, 2) NOT NULL; oracle: NUMERIC(12, 2) NOT NULL.

Column.float(name: str, precision: int | None=None, *, asdecimal: bool=False, decimal_return_scale: int | None=None) -> Float
Float(precision: int | None=None, *, asdecimal: bool=False, decimal_return_scale: int | None=None)

Use for approximate measurements. precision is dialect dependent and does not count decimal places. asdecimal=False normally returns float; decimal_return_scale controls conversion to Decimal. For Oracle, FLOAT receives calculated binary precision when precision is supplied.

from orionis.database.schema.blueprint import Blueprint
from orionis.orm import Float
table = Blueprint()
column = table.float("measurement", 24)
model_column = Float(24)

The factory returns Float; the constructor returns a new instance of that type. Both inherit ColumnDefinition.

DDL from the probe declaration: sqlite: FLOAT NOT NULL; mysql: FLOAT NOT NULL; pgsql: FLOAT NOT NULL; sqlserver: FLOAT NOT NULL; oracle: FLOAT NOT NULL.

Column.double(name: str, precision: int | None=None, *, asdecimal: bool=False, decimal_return_scale: int | None=None) -> Double
Double(precision: int | None=None, *, asdecimal: bool=False, decimal_return_scale: int | None=None)

Use for approximate measurements requiring double precision. This shares asdecimal and decimal_return_scale with Float and does not replace Numeric for exact monetary calculations.

from orionis.database.schema.blueprint import Blueprint
from orionis.orm import Double
table = Blueprint()
column = table.double("distance")
model_column = Double()

The factory returns Double; the constructor returns a new instance of that type. Both inherit ColumnDefinition.

DDL from the probe declaration: sqlite: DOUBLE NOT NULL; mysql: DOUBLE NOT NULL; pgsql: DOUBLE PRECISION NOT NULL; sqlserver: DOUBLE PRECISION NOT NULL; oracle: DOUBLE PRECISION NOT NULL.

Column.string(name: str, length: int | None=255, collation: str | None=None) -> String
String(length: int | None=255, collation: str | None=None)

Use for names, emails, or codes. length defaults to 255; None omits a declared bound where the dialect permits it. Noninteger lengths or lengths <=0 raise ValueError. collation is forwarded to the dialect and must exist in the database. SQLite does not enforce a VARCHAR length merely from its declaration.

from orionis.database.schema.blueprint import Blueprint
from orionis.orm import String
table = Blueprint()
column = table.string("title", 120)
model_column = String(120)

The factory returns String; the constructor returns a new instance of that type. Both inherit ColumnDefinition.

DDL from the probe declaration: sqlite: VARCHAR(80) NOT NULL; mysql: VARCHAR(80) NOT NULL; pgsql: VARCHAR(80) NOT NULL; sqlserver: VARCHAR(80) NOT NULL; oracle: VARCHAR2(80 CHAR) NOT NULL.

Column.text(name: str, length: int | None=None, collation: str | None=None) -> Text
Text(length: int | None=None, collation: str | None=None)

Use for descriptions and documents. length and collation are stored as metadata; their effect depends on the dialect. This adds no payload length validation.

from orionis.database.schema.blueprint import Blueprint
from orionis.orm import Text
table = Blueprint()
column = table.text("description")
model_column = Text()

The factory returns Text; the constructor returns a new instance of that type. Both inherit ColumnDefinition.

DDL from the probe declaration: sqlite: TEXT NOT NULL; mysql: TEXT NOT NULL; pgsql: TEXT NOT NULL; sqlserver: TEXT NOT NULL; oracle: CLOB NOT NULL.

Column.unicode(name: str, length: int | None=None, collation: str | None=None) -> Unicode
Unicode(length: int | None=None, collation: str | None=None)

Use for international text requiring the toolkit Unicode variant. SQL Server compiles NVARCHAR; this does not force the connection charset on other backends. Supply a length when needed: the default is None.

from orionis.database.schema.blueprint import Blueprint
from orionis.orm import Unicode
table = Blueprint()
column = table.unicode("display_name", 120)
model_column = Unicode(120)

The factory returns Unicode; the constructor returns a new instance of that type. Both inherit ColumnDefinition.

DDL from the probe declaration: sqlite: VARCHAR(80) NOT NULL; mysql: VARCHAR(80) NOT NULL; pgsql: VARCHAR(80) NOT NULL; sqlserver: NVARCHAR(80) NOT NULL; oracle: VARCHAR2(80 CHAR) NOT NULL.

Column.unicodeText(name: str, length: int | None=None, collation: str | None=None) -> UnicodeText
UnicodeText(length: int | None=None, collation: str | None=None)

Use for international documents. The checked dialects compile NTEXT for SQL Server and CLOB for Oracle; choose a different type when your schema requires another native representation.

from orionis.database.schema.blueprint import Blueprint
from orionis.orm import UnicodeText
table = Blueprint()
column = table.unicodeText("biography")
model_column = UnicodeText()

The factory returns UnicodeText; the constructor returns a new instance of that type. Both inherit ColumnDefinition.

DDL from the probe declaration: sqlite: TEXT NOT NULL; mysql: TEXT NOT NULL; pgsql: TEXT NOT NULL; sqlserver: NTEXT NOT NULL; oracle: CLOB NOT NULL.

Column.date(name: str) -> Date
Date()

Use for calendar dates represented by datetime.date. This type adds neither timezone nor time of day.

from orionis.database.schema.blueprint import Blueprint
from orionis.orm import Date
table = Blueprint()
column = table.date("birthday")
model_column = Date()

The factory returns Date; the constructor returns a new instance of that type. Both inherit ColumnDefinition.

DDL from the probe declaration: sqlite: DATE NOT NULL; mysql: DATE NOT NULL; pgsql: DATE NOT NULL; sqlserver: DATETIME NOT NULL; oracle: DATE NOT NULL.

Column.time(name: str) -> Time
Time()

Use for time of day, represented by datetime.time according to driver conversion. Orionis exposes no timezone argument here. Generated TIME syntax does not guarantee acceptance by every server.

from orionis.database.schema.blueprint import Blueprint
from orionis.orm import Time
table = Blueprint()
column = table.time("opens_at")
model_column = Time()

The factory returns Time; the constructor returns a new instance of that type. Both inherit ColumnDefinition.

DDL from the probe declaration: sqlite: TIME NOT NULL; mysql: TIME NOT NULL; pgsql: TIME WITHOUT TIME ZONE NOT NULL; sqlserver: DATETIME NOT NULL; oracle: TIME NOT NULL.

Column.dateTime(name: str, *, timezone: bool=False) -> DateTime
DateTime(*, timezone: bool=False)

Use for instants or dates with time. timezone defaults to False; True requests backend type support but neither converts dates nor preserves a timezone on every driver. PostgreSQL emits TIMESTAMP WITH/WITHOUT TIME ZONE.

from orionis.database.schema.blueprint import Blueprint
from orionis.orm import DateTime
table = Blueprint()
column = table.dateTime("published_at", timezone=True)
model_column = DateTime(timezone=True)

The factory returns DateTime; the constructor returns a new instance of that type. Both inherit ColumnDefinition.

DDL from the probe declaration: sqlite: DATETIME NOT NULL; mysql: DATETIME NOT NULL; pgsql: TIMESTAMP WITHOUT TIME ZONE NOT NULL; sqlserver: DATETIME NOT NULL; oracle: DATE NOT NULL.

Column.interval(name: str, *, native: bool=True, second_precision: int | None=None, day_precision: int | None=None) -> Interval
Interval(*, native: bool=True, second_precision: int | None=None, day_precision: int | None=None)

Use for datetime.timedelta durations. native=True uses INTERVAL where supported by PostgreSQL/Oracle; other dialects emulate it using date/time storage. second_precision and day_precision are relevant to native variants.

from orionis.database.schema.blueprint import Blueprint
from orionis.orm import Interval
table = Blueprint()
column = table.interval("duration", native=True)
model_column = Interval(native=True)

The factory returns Interval; the constructor returns a new instance of that type. Both inherit ColumnDefinition.

DDL from the probe declaration: sqlite: DATETIME NOT NULL; mysql: DATETIME NOT NULL; pgsql: INTERVAL NOT NULL; sqlserver: DATETIME NOT NULL; oracle: INTERVAL DAY TO SECOND NOT NULL.

Column.largeBinary(name: str, length: int | None=None) -> LargeBinary
LargeBinary(length: int | None=None)

Use for bytes, small images, or binary results. length defaults to None; a supplied length must be a positive integer or ValueError is raised. This adapts to BLOB/BYTEA/IMAGE by dialect and represents neither a file nor a Storage path.

from orionis.database.schema.blueprint import Blueprint
from orionis.orm import LargeBinary
table = Blueprint()
column = table.largeBinary("digest", 64)
model_column = LargeBinary(64)

The factory returns LargeBinary; the constructor returns a new instance of that type. Both inherit ColumnDefinition.

DDL from the probe declaration: sqlite: BLOB NOT NULL; mysql: BLOB NOT NULL; pgsql: BYTEA NOT NULL; sqlserver: IMAGE NOT NULL; oracle: BLOB NOT NULL.

Column.uuid(name: str, *, as_uuid: bool=True, native_uuid: bool=True) -> Uuid
Uuid(*, as_uuid: bool=True, native_uuid: bool=True)

Use for application supplied identifiers. as_uuid=True handles uuid.UUID; native_uuid=True requests UUID/UNIQUEIDENTIFIER where available and uses CHAR(32) otherwise. This does not generate uuid4 automatically; use default(uuid4) or supply a value.

from orionis.database.schema.blueprint import Blueprint
from orionis.orm import Uuid
table = Blueprint()
column = table.uuid("public_id").unique()
model_column = Uuid().unique()

The factory returns Uuid; the constructor returns a new instance of that type. Both inherit ColumnDefinition.

DDL from the probe declaration: sqlite: CHAR(32) NOT NULL; mysql: CHAR(32) NOT NULL; pgsql: UUID NOT NULL; sqlserver: UNIQUEIDENTIFIER NOT NULL; oracle: CHAR(32) NOT NULL.

Column.enum(name: str, *enums: str, constraint_name: str | None=None, create_constraint: bool=False, native_enum: bool=True, length: int | None=None, validate_strings: bool=False) -> Enum
Enum(*enums: str, name: str | None=None, create_constraint: bool=False, native_enum: bool=True, length: int | None=None, validate_strings: bool=False)

Use for a closed set of nonempty string states. Missing or invalid members raise ValueError. native_enum=True requests native ENUM; give it constraint_name on PostgreSQL (name in the constructor). native_enum=False uses VARCHAR; create_constraint=True adds CHECK where applicable. validate_strings validates values through the type processor and does not create an HTTP schema.

from orionis.database.schema.blueprint import Blueprint
from orionis.orm import Enum
table = Blueprint()
column = table.enum("status", "draft", "published", constraint_name="article_status", native_enum=False, create_constraint=True, validate_strings=True)
model_column = Enum("draft", "published", name="article_status", native_enum=False, create_constraint=True, validate_strings=True)

The factory returns Enum; the constructor returns a new instance of that type. Both inherit ColumnDefinition.

DDL from the probe declaration: sqlite: VARCHAR(9) NOT NULL; mysql: ENUM('draft','published') NOT NULL; pgsql: article_status NOT NULL; sqlserver: VARCHAR(9) NOT NULL; oracle: VARCHAR(9 CHAR) NOT NULL.

These fragments use draft/published members and the name article_status, with the default native_enum=True. The executable example above deliberately selects emulation and validation.

Column.pickleType(name: str, protocol: int=5, pickler: object | None=None, impl: object | None=None) -> PickleType
PickleType(protocol: int=5, pickler: object | None=None, impl: object | None=None)

Use for internal Python objects stored as binary pickle data. The literal current default is protocol=5. pickler and impl are accepted and stored, but SQLCompiler only forwards protocol: customizing them does not change the SQL type used. Do not deserialize third party controlled content; use JSON for interoperable exchange where supported.

from orionis.database.schema.blueprint import Blueprint
from orionis.orm import PickleType
table = Blueprint()
column = table.pickleType("internal_state", protocol=5)
model_column = PickleType(protocol=5)

The factory returns PickleType; the constructor returns a new instance of that type. Both inherit ColumnDefinition.

DDL from the probe declaration: sqlite: BLOB NOT NULL; mysql: BLOB NOT NULL; pgsql: BYTEA NOT NULL; sqlserver: IMAGE NOT NULL; oracle: BLOB NOT NULL.

Column.strictInt(name: str) -> StrictInt
StrictInt()

Request SQL INTEGER. The factory is named strictInt although generated SQL is INTEGER. This adds neither Python range validation nor unsigned behavior.

from orionis.database.schema.blueprint import Blueprint
from orionis.orm import StrictInt
table = Blueprint()
column = table.strictInt("quantity")
model_column = StrictInt()

The factory returns StrictInt; the constructor returns a new instance of that type. Both inherit ColumnDefinition.

DDL from the probe declaration: sqlite: INTEGER NOT NULL; mysql: INTEGER NOT NULL; pgsql: INTEGER NOT NULL; sqlserver: INTEGER NOT NULL; oracle: INTEGER NOT NULL.

Column.strictBigInt(name: str) -> StrictBigInt
StrictBigInt()

Request literal BIGINT; unlike BigInteger, Oracle does not adapt it to NUMBER(19). Final acceptance depends on the server.

from orionis.database.schema.blueprint import Blueprint
from orionis.orm import StrictBigInt
table = Blueprint()
column = table.strictBigInt("sequence")
model_column = StrictBigInt()

The factory returns StrictBigInt; the constructor returns a new instance of that type. Both inherit ColumnDefinition.

DDL from the probe declaration: sqlite: BIGINT NOT NULL; mysql: BIGINT NOT NULL; pgsql: BIGINT NOT NULL; sqlserver: BIGINT NOT NULL; oracle: BIGINT NOT NULL.

Column.strictSmallInt(name: str) -> StrictSmallInt
StrictSmallInt()

Request SMALLINT. The backend determines range and storage; Orionis does not validate the range before persistence.

from orionis.database.schema.blueprint import Blueprint
from orionis.orm import StrictSmallInt
table = Blueprint()
column = table.strictSmallInt("priority")
model_column = StrictSmallInt()

The factory returns StrictSmallInt; the constructor returns a new instance of that type. Both inherit ColumnDefinition.

DDL from the probe declaration: sqlite: SMALLINT NOT NULL; mysql: SMALLINT NOT NULL; pgsql: SMALLINT NOT NULL; sqlserver: SMALLINT NOT NULL; oracle: SMALLINT NOT NULL.

Column.strictDecimal(name: str, precision: int | None=10, scale: int | None=2, decimal_return_scale: int | None=None, *, asdecimal: bool=True) -> StrictDecimal
StrictDecimal(precision: int | None=10, scale: int | None=2, decimal_return_scale: int | None=None, *, asdecimal: bool=True)

Request DECIMAL with default precision=10 and scale=2. This shares Numeric validation: compatible integers for both arguments, or None for both. Use it to request DECIMAL instead of NUMERIC.

from orionis.database.schema.blueprint import Blueprint
from orionis.orm import StrictDecimal
table = Blueprint()
column = table.strictDecimal("price", 12, 2)
model_column = StrictDecimal(12, 2)

The factory returns StrictDecimal; the constructor returns a new instance of that type. Both inherit ColumnDefinition.

DDL from the probe declaration: sqlite: DECIMAL(12, 2) NOT NULL; mysql: DECIMAL(12, 2) NOT NULL; pgsql: DECIMAL(12, 2) NOT NULL; sqlserver: DECIMAL(12, 2) NOT NULL; oracle: DECIMAL(12, 2) NOT NULL.

Column.strictReal(name: str, precision: int | None=None, *, asdecimal: bool=False, decimal_return_scale: int | None=None) -> StrictReal
StrictReal(precision: int | None=None, *, asdecimal: bool=False, decimal_return_scale: int | None=None)

Request REAL for approximate values. precision, asdecimal, and decimal_return_scale retain the Float contract; actual precision depends on the server.

from orionis.database.schema.blueprint import Blueprint
from orionis.orm import StrictReal
table = Blueprint()
column = table.strictReal("ratio")
model_column = StrictReal()

The factory returns StrictReal; the constructor returns a new instance of that type. Both inherit ColumnDefinition.

DDL from the probe declaration: sqlite: REAL NOT NULL; mysql: REAL NOT NULL; pgsql: REAL NOT NULL; sqlserver: REAL NOT NULL; oracle: REAL NOT NULL.

strictDoublePrecision: Explicit DOUBLE PRECISION

Section titled “strictDoublePrecision: Explicit DOUBLE PRECISION”
Column.strictDoublePrecision(name: str, precision: int | None=None, *, asdecimal: bool=False, decimal_return_scale: int | None=None) -> StrictDoublePrecision
StrictDoublePrecision(precision: int | None=None, *, asdecimal: bool=False, decimal_return_scale: int | None=None)

Request literal DOUBLE PRECISION. This shares numeric representation options with Double; the compiler does not check that every server accepts this syntax.

from orionis.database.schema.blueprint import Blueprint
from orionis.orm import StrictDoublePrecision
table = Blueprint()
column = table.strictDoublePrecision("latitude")
model_column = StrictDoublePrecision()

The factory returns StrictDoublePrecision; the constructor returns a new instance of that type. Both inherit ColumnDefinition.

DDL from the probe declaration: sqlite: DOUBLE PRECISION NOT NULL; mysql: DOUBLE PRECISION NOT NULL; pgsql: DOUBLE PRECISION NOT NULL; sqlserver: DOUBLE PRECISION NOT NULL; oracle: DOUBLE PRECISION NOT NULL.

Column.strictChar(name: str, length: int | None=None, collation: str | None=None) -> StrictChar
StrictChar(length: int | None=None, collation: str | None=None)

Use for fixed length codes such as country codes. length=None does not invent a bound; supply the bound required by the backend. collation must be supported.

from orionis.database.schema.blueprint import Blueprint
from orionis.orm import StrictChar
table = Blueprint()
column = table.strictChar("country", 2)
model_column = StrictChar(2)

The factory returns StrictChar; the constructor returns a new instance of that type. Both inherit ColumnDefinition.

DDL from the probe declaration: sqlite: CHAR(2) NOT NULL; mysql: CHAR(2) NOT NULL; pgsql: CHAR(2) NOT NULL; sqlserver: CHAR(2) NOT NULL; oracle: CHAR(2) NOT NULL.

Column.strictVarChar(name: str, length: int | None=255, collation: str | None=None) -> StrictVarChar
StrictVarChar(length: int | None=255, collation: str | None=None)

Use for variable text with length=255 by default. This requests literal VARCHAR rather than every String adaptation; Oracle compiles VARCHAR instead of VARCHAR2. The backend interprets length and collation.

from orionis.database.schema.blueprint import Blueprint
from orionis.orm import StrictVarChar
table = Blueprint()
column = table.strictVarChar("reference", 80)
model_column = StrictVarChar(80)

The factory returns StrictVarChar; the constructor returns a new instance of that type. Both inherit ColumnDefinition.

DDL from the probe declaration: sqlite: VARCHAR(80) NOT NULL; mysql: VARCHAR(80) NOT NULL; pgsql: VARCHAR(80) NOT NULL; sqlserver: VARCHAR(80) NOT NULL; oracle: VARCHAR(80 CHAR) NOT NULL.

Column.strictNChar(name: str, length: int | None=None, collation: str | None=None) -> StrictNChar
StrictNChar(length: int | None=None, collation: str | None=None)

Use for fixed length Unicode codes when the backend offers a national character type. Do not assume PostgreSQL supports NCHAR merely because its DDL can be compiled.

from orionis.database.schema.blueprint import Blueprint
from orionis.orm import StrictNChar
table = Blueprint()
column = table.strictNChar("code", 2)
model_column = StrictNChar(2)

The factory returns StrictNChar; the constructor returns a new instance of that type. Both inherit ColumnDefinition.

DDL from the probe declaration: sqlite: NCHAR(2) NOT NULL; mysql: NATIONAL CHAR(2) NOT NULL; pgsql: NCHAR(2) NOT NULL; sqlserver: NCHAR(2) NOT NULL; oracle: NCHAR(2) NOT NULL.

Column.strictNVarChar(name: str, length: int | None=None, collation: str | None=None) -> StrictNVarChar
StrictNVarChar(length: int | None=None, collation: str | None=None)

Use for variable national text. SQL Server uses NVARCHAR, Oracle uses NVARCHAR2, and MySQL emits NATIONAL VARCHAR. Use String/Unicode on backends without those types.

from orionis.database.schema.blueprint import Blueprint
from orionis.orm import StrictNVarChar
table = Blueprint()
column = table.strictNVarChar("label", 80)
model_column = StrictNVarChar(80)

The factory returns StrictNVarChar; the constructor returns a new instance of that type. Both inherit ColumnDefinition.

DDL from the probe declaration: sqlite: NVARCHAR(80) NOT NULL; mysql: NATIONAL VARCHAR(80) NOT NULL; pgsql: NVARCHAR(80) NOT NULL; sqlserver: NVARCHAR(80) NOT NULL; oracle: NVARCHAR2(80) NOT NULL.

Column.strictClob(name: str, length: int | None=None, collation: str | None=None) -> StrictClob
StrictClob(length: int | None=None, collation: str | None=None)

Request CLOB for backends implementing it. Other dialects may emit CLOB without verifying its availability; use Text for adaptable text.

from orionis.database.schema.blueprint import Blueprint
from orionis.orm import StrictClob
table = Blueprint()
column = table.strictClob("document")
model_column = StrictClob()

The factory returns StrictClob; the constructor returns a new instance of that type. Both inherit ColumnDefinition.

DDL from the probe declaration: sqlite: CLOB NOT NULL; mysql: CLOB NOT NULL; pgsql: CLOB NOT NULL; sqlserver: CLOB NOT NULL; oracle: CLOB NOT NULL.

Column.strictTimestamp(name: str, *, timezone: bool=False) -> StrictTimestamp
StrictTimestamp(*, timezone: bool=False)

Request TIMESTAMP with timezone=False by default. On SQL Server, TIMESTAMP means binary rowversion rather than date/time: use DateTime for dates. timezone=True depends on the backend.

from orionis.database.schema.blueprint import Blueprint
from orionis.orm import StrictTimestamp
table = Blueprint()
column = table.strictTimestamp("recorded_at", timezone=True)
model_column = StrictTimestamp(timezone=True)

The factory returns StrictTimestamp; the constructor returns a new instance of that type. Both inherit ColumnDefinition.

DDL from the probe declaration: sqlite: TIMESTAMP NOT NULL; mysql: TIMESTAMP NOT NULL; pgsql: TIMESTAMP WITHOUT TIME ZONE NOT NULL; sqlserver: TIMESTAMP NOT NULL; oracle: TIMESTAMP NOT NULL.

Column.strictBinary(name: str, length: int | None=None) -> StrictBinary
StrictBinary(length: int | None=None)

Use for fixed length bytes where the backend implements BINARY. PostgreSQL does not automatically receive BYTEA instead of BINARY; LargeBinary provides adaptation.

from orionis.database.schema.blueprint import Blueprint
from orionis.orm import StrictBinary
table = Blueprint()
column = table.strictBinary("token", 16)
model_column = StrictBinary(16)

The factory returns StrictBinary; the constructor returns a new instance of that type. Both inherit ColumnDefinition.

DDL from the probe declaration: sqlite: BINARY(16) NOT NULL; mysql: BINARY(16) NOT NULL; pgsql: BINARY(16) NOT NULL; sqlserver: BINARY(16) NOT NULL; oracle: BINARY(16) NOT NULL.

Column.strictVarBinary(name: str, length: int | None=None) -> StrictVarBinary
StrictVarBinary(length: int | None=None)

Use for variable length bytes on backends with VARBINARY. length=None is retained; no bound or upload limit is added automatically.

from orionis.database.schema.blueprint import Blueprint
from orionis.orm import StrictVarBinary
table = Blueprint()
column = table.strictVarBinary("payload", 64)
model_column = StrictVarBinary(64)

The factory returns StrictVarBinary; the constructor returns a new instance of that type. Both inherit ColumnDefinition.

DDL from the probe declaration: sqlite: VARBINARY(64) NOT NULL; mysql: VARBINARY(64) NOT NULL; pgsql: VARBINARY(64) NOT NULL; sqlserver: VARBINARY(64) NOT NULL; oracle: VARBINARY(64) NOT NULL.

Column.strictBlob(name: str, length: int | None=None) -> StrictBlob
StrictBlob(length: int | None=None)

Request literal BLOB; this does not use BYTEA on PostgreSQL or IMAGE on SQL Server. Prefer LargeBinary for adaptation across those backends.

from orionis.database.schema.blueprint import Blueprint
from orionis.orm import StrictBlob
table = Blueprint()
column = table.strictBlob("payload")
model_column = StrictBlob()

The factory returns StrictBlob; the constructor returns a new instance of that type. Both inherit ColumnDefinition.

DDL from the probe declaration: sqlite: BLOB NOT NULL; mysql: BLOB NOT NULL; pgsql: BLOB NOT NULL; sqlserver: BLOB NOT NULL; oracle: BLOB NOT NULL.

Column.strictJson(name: str, *, none_as_null: bool=False) -> StrictJson
StrictJson(*, none_as_null: bool=False)

Use for JSON structures. none_as_null=False encodes None as JSON null; True treats it as SQL NULL in typed operations. nullable separately controls whether SQL NULL is permitted. SQL Server compiles NVARCHAR(max); backend JSON support is still required. This is not JSONB and adds no JSON operators to the Query Builder.

from orionis.database.schema.blueprint import Blueprint
from orionis.orm import StrictJson
table = Blueprint()
column = table.strictJson("preferences", none_as_null=True).nullable()
model_column = StrictJson(none_as_null=True).nullable()

The factory returns StrictJson; the constructor returns a new instance of that type. Both inherit ColumnDefinition.

DDL from the probe declaration: sqlite: JSON NOT NULL; mysql: JSON NOT NULL; pgsql: JSON NOT NULL; sqlserver: NVARCHAR(max) NOT NULL; oracle: JSON NOT NULL.

strictArray: ARRAY: metadata without compilation

Section titled “strictArray: ARRAY: metadata without compilation”
Column.strictArray(name: str, item_type: ColumnDefinition, *, as_tuple: bool=False, dimensions: int | None=None, zero_indexes: bool=False) -> StrictArray
StrictArray(item_type: ColumnDefinition, *, as_tuple: bool=False, dimensions: int | None=None, zero_indexes: bool=False)

This accepts item_type: ColumnDefinition, as_tuple=False, dimensions=None, and zero_indexes=False. Element definitions, dimensions, and index conversion settings are retained, but no SQL builder is registered: materialization raises QueryException even on PostgreSQL. This is not offered as functional ARRAY storage.

from orionis.database.schema.blueprint import Blueprint
from orionis.orm import StrictArray, Integer
table = Blueprint()
column = table.strictArray("scores", Integer(), dimensions=1)
model_column = StrictArray(Integer(), dimensions=1)

The factory returns StrictArray; the constructor returns a new instance of that type. Both inherit ColumnDefinition.

Verified limit: creating the definition is valid; SQLCompiler.compileCreateTable rejects it with QueryException: No SQL type registered for column type. No backend is enabled for this declaration in the current compiler.

matchType: MatchType: marker without compilation

Section titled “matchType: MatchType: marker without compilation”
Column.matchType(name: str) -> MatchType
MatchType()

This marker describes a MATCH result. It can be constructed without options but has no SQL builder and cannot create a physical column. It does not provide ORM full text search.

from orionis.database.schema.blueprint import Blueprint
from orionis.orm import MatchType
table = Blueprint()
column = table.matchType("match_result")
model_column = MatchType()

The factory returns MatchType; the constructor returns a new instance of that type. Both inherit ColumnDefinition.

Verified limit: creating the definition is valid; SQLCompiler.compileCreateTable rejects it with QueryException: No SQL type registered for column type. No backend is enabled for this declaration in the current compiler.

numericCommon: NumericCommon: marker without compilation

Section titled “numericCommon: NumericCommon: marker without compilation”
Column.numericCommon(name: str) -> NumericCommon
NumericCommon()

This numeric marker has no arguments and does not translate to SQL. Choose Numeric, Float, Double, or another concrete type for physical columns.

from orionis.database.schema.blueprint import Blueprint
from orionis.orm import NumericCommon
table = Blueprint()
column = table.numericCommon("numeric_marker")
model_column = NumericCommon()

The factory returns NumericCommon; the constructor returns a new instance of that type. Both inherit ColumnDefinition.

Verified limit: creating the definition is valid; SQLCompiler.compileCreateTable rejects it with QueryException: No SQL type registered for column type. No backend is enabled for this declaration in the current compiler.

schemaType: SchemaType: marker without compilation

Section titled “schemaType: SchemaType: marker without compilation”
Column.schemaType(name: str, schema_name: str | None=None) -> SchemaType
SchemaType(name: str | None=None)

This retains a schema construct name (schema_name on Column; name on the constructor). It creates neither SQL schemas nor user defined types; materializing a column raises QueryException.

from orionis.database.schema.blueprint import Blueprint
from orionis.orm import SchemaType
table = Blueprint()
column = table.schemaType("schema_marker", "named_type")
model_column = SchemaType("named_type")

The factory returns SchemaType; the constructor returns a new instance of that type. Both inherit ColumnDefinition.

Verified limit: creating the definition is valid; SQLCompiler.compileCreateTable rejects it with QueryException: No SQL type registered for column type. No backend is enabled for this declaration in the current compiler.

The examples above separate construction from execution. Within a migration, the blueprint collects the same definitions and Schema materializes them on successful context exit.

from orionis.database import Migration
from orionis.support.facades import Schema
class CreateProducts(Migration):
async def up(self) -> None:
async with Schema.create("products") as table:
table.id()
table.string("name", 120)
table.numeric("price", 12, 2).default(0)
table.boolean("active").default(True)
table.timestamps()
async def down(self) -> None:
await Schema.drop("products")