MoorColumn class
A column, as specified by a getter in a table.
- Implemented types
- Available extensions
Constructors
-
MoorColumn({required ColumnType type, required String dartGetterName, required ColumnName name, String? overriddenJsonName, String? customConstraints, bool nullable = false, List<
ColumnFeature> features = const [], String? defaultArgument, String? clientDefaultCode, UsedTypeConverter? typeConverter, ColumnDeclaration? declaration, String? documentationComment, ColumnGeneratedAs? generatedAs})
Properties
- clientDefaultCode → String?
-
Dart code for the
clientDefault
expression, or null if it hasn't been set.final - customConstraints → String?
-
If this columns has custom constraints that should be used instead of the
default ones.
final
- dartGetterName → String
-
The getter name of this column in the table class. It will also be used
as getter name in the TableInfo class (as it needs to override the field)
and in the generated data class that will be generated for each table.
final
- declaration → ColumnDeclaration?
-
The declaration of this column, contains information about where this
column was created in source code.
final
- declaredInMoorFile → bool
-
Whether this column was declared inside a moor file.
no setter
- defaultArgument → String?
-
Dart code that generates the default expression for this column, or null
if there is no default expression.
final
- documentationComment → String?
-
The documentation comment associated with this column
final
- dslColumnTypeName → String
-
The column type from the dsl library. For instance, if a table has
declared an
IntColumn
, the matching dsl column name would also be anIntColumn
.no setter -
features
→ List<
ColumnFeature> -
final
- generatedAs → ColumnGeneratedAs?
-
final
- hasAI → bool
-
Whether this column has auto increment.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- isArray → bool
-
Whether this type is an array in sql.
no setteroverride
- isDeclaredInDart → bool
-
Available on HasDeclaration, provided by the DeclarationUtils extension
no setter - isDeclaredInDriftFile → bool
-
Available on HasDeclaration, provided by the DeclarationUtils extension
no setter - isGenerated → bool
-
no setter
- name → ColumnName
-
The name of this column, as chosen by the user
final
- nullable → bool
-
Whether the user has explicitly declared this column to be nullable, the
default is false
final
- nullableInDart → bool
-
Available on HasType, provided by the OperationOnTypes extension
Whether this type is nullable in Dartno setter - overriddenJsonName → String?
-
An (optional) name to use as a json key instead of the dartGetterName.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sqlTypeName → String
-
Available on HasType, provided by the OperationOnTypes extension
The class inside the moor library that represents the same sql type as this column.no setter - table ↔ MoorTable?
-
Parent table
getter/setter pair
- type → ColumnType
-
The sql type of this column
final
- typeConverter → UsedTypeConverter?
-
The UsedTypeConverter, if one has been set on this column.
final
- variableTypeName → String
-
Available on HasType, provided by the OperationOnTypes extension
the Dart type of this column that can be handled by moors type mapping. Basically the same as dartTypeCode, minus custom types and nullability.no setter
Methods
-
dartTypeCode(
[GenerationOptions options = const GenerationOptions()]) → String -
Available on HasType, provided by the OperationOnTypes extension
The dart type that matches the values of this column. For instance, if a table has declared anIntColumn
, the matching dart type name would be int. -
getJsonKey(
[MoorOptions options = const MoorOptions.defaults()]) → String -
innerColumnType(
[GenerationOptions options = const GenerationOptions()]) → String -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
sqlType(
) → SqlType -
thisIfNeeded(
Set< String> locals) → String -
Available on MoorColumn, provided by the WriterUtilsForColumns extension
Adds anthis.
prefix is the dartGetterName is inlocals
. -
toString(
) → String -
A string representation of this object.
inherited
-
variableTypeCode(
[GenerationOptions options = const GenerationOptions()]) → String -
Available on HasType, provided by the OperationOnTypes extension
The moor Dart type that matches the type of this column. -
variableTypeCodeWithoutArray(
[GenerationOptions options = const GenerationOptions()]) → String -
Available on HasType, provided by the OperationOnTypes extension
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited