SchemaColumn class Null safety
A portable representation of a database column.
Instances of this type contain the database-only details of a ManagedPropertyDescription.
Constructors
- SchemaColumn(String name, ManagedPropertyType type, {bool? isIndexed = false, bool? isNullable = false, bool? autoincrement = false, bool? isUnique = false, String? defaultValue, bool? isPrimaryKey = false})
-
Creates an instance of this type from name,
type
and other properties. - SchemaColumn.empty()
- Creates an empty instance of this type.
- SchemaColumn.from(SchemaColumn otherColumn)
-
Creates a copy of
otherColumn
. -
SchemaColumn.fromMap(Map<
String, dynamic> map) -
Creates an instance of this type from
map
. - SchemaColumn.fromProperty(ManagedPropertyDescription desc)
-
Creates an instance of this type to mirror
desc
. - SchemaColumn.relationship(String name, ManagedPropertyType type, {bool? isNullable = true, bool? isUnique = false, DeleteRule rule = DeleteRule.nullify})
- A convenience constructor for properties that represent foreign key relationships.
Properties
- autoincrement ↔ bool?
-
Whether or not this column is autoincremented.
read / write
- defaultValue ↔ String?
-
The default value for this column when inserted into a database.
read / write
- deleteRule ↔ DeleteRule?
-
The delete rule for this column if it is a foreign key column.
read / write
- hashCode → int
-
The hash code for this object.
read-onlyinherited
- isForeignKey → bool
-
Whether or not this column is a foreign key column.
read-only
- isIndexed ↔ bool?
-
Whether or not this column is indexed.
read / write
- isNullable ↔ bool?
-
Whether or not this column is nullable.
read / write
- isPrimaryKey ↔ bool?
-
Whether or not this column is the primary key of its table.
read / write
- isUnique ↔ bool?
-
Whether or not this column is unique.
read / write
- name ↔ String
-
The name of this column.
read / write
-
The related column if this column is a foreign key column.
read / write
-
The related table name if this column is a foreign key column.
read / write
- runtimeType → Type
-
A representation of the runtime type of the object.
read-onlyinherited
- table ↔ SchemaTable?
-
The SchemaTable this column belongs to.
read / write
- type ↔ ManagedPropertyType?
-
The type of this column in a ManagedDataModel.
read / write
- typeString → String?
-
The String representation of this column's type.
read-only
Methods
-
asMap(
) → Map< String, dynamic> - Returns portable representation of this instance.
-
differenceFrom(
SchemaColumn column) → SchemaColumnDifference - The differences between two columns.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
deleteRuleForDeleteRuleString(
String? rule) → DeleteRule? - Returns inverse of deleteRuleStringForDeleteRule.
-
deleteRuleStringForDeleteRule(
DeleteRule rule) → String? - Returns string representation of DeleteRule.
-
typeFromTypeString(
String? type) → ManagedPropertyType? - Returns inverse of typeStringForType.
-
typeStringForType(
ManagedPropertyType? type) → String? - Returns string representation of ManagedPropertyType.