Skip to content

Fields

mydborm.fields.Field

Base class for all field types. Every field maps to a database column.

to_sql_def(dialect='mysql')

Return the SQL column definition string.

validate(value)

Validate and coerce value before insert/update.

mydborm.fields.IntField

Bases: Field

Integer column — INT in MySQL, INTEGER in YSQL.

mydborm.fields.StrField

Bases: Field

Variable-length string — VARCHAR(n).

mydborm.fields.BoolField

Bases: Field

Boolean — TINYINT(1) in MySQL, BOOLEAN in PostgreSQL/Yugabyte.

mydborm.fields.FloatField

Bases: Field

Floating point — FLOAT column.

mydborm.fields.EmailValidator

Bases: ValidationRule

Validates email address format.

mydborm.fields.RangeValidator

Bases: ValidationRule

Validates numeric value is within a range.