MFieldYear class

MySQL YEAR field type.

Represents a year field in MySQL. Can store 4-digit years (1901 to 2155) or 2-digit years (70-99 for 1970-1999, 00-69 for 2000-2069).

Inheritance

Constructors

MFieldYear.new({required String name, bool isPrimaryKey = false, bool isAutoIncrement = false, bool isNullable = false, String defaultValue = '', String? comment, List<ValidatorEvent> validators = const [], int length = 4})
Creates a YEAR field.

Properties

comment String?
Optional comment for the field
getter/setter pairinherited
defaultValue String
Default value for the field (empty string means no default)
getter/setter pairinherited
hashCode int
The hash code for this object.
no setterinherited
isAutoIncrement bool
Whether this field has auto-increment enabled
getter/setter pairinherited
isNullable bool
Whether this field allows NULL values
getter/setter pairinherited
isPrimaryKey bool
Whether this field is a primary key
getter/setter pairinherited
name String
The name of the field/column
getter/setter pairinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type FieldTypes
The MySQL data type for this field
getter/setter pairinherited
validators List<ValidatorEvent>
getter/setter pairinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toSQL() String
Generates the SQL field definition for this field.
inherited
toString() String
A string representation of this object.
inherited
validate(dynamic value) Future<List<String>>
Validates the provided value against the field's constraints. Returns a list of validation error messages. @param value is the value to validate @returns a list of validation error messages, empty if valid
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited