MoorTable class Null safety

A parsed table, declared in code by extending Table and referencing that table in @UseMoor or @UseDao.

Available Extensions


MoorTable({ClassElement? fromClass, List<MoorColumn> columns = const [], required String sqlName, required String dartTypeName, Set<MoorColumn>? primaryKey, List<Set<MoorColumn>>? uniqueKeys, String? overriddenName, bool? overrideWithoutRowId, List<String>? overrideTableConstraints, bool? overrideDontWriteConstraints, TableDeclaration? declaration, ExistingRowClass? existingRowClass, String? customParentClass, bool isStrict = false})


columns List<MoorColumn>
The columns declared in this table.
converters Iterable<UsedTypeConverter>
Finds all type converters used in this tables.
createVirtual String?
If this table isVirtualTable, returns the CREATE VIRTUAL TABLE statement to create this table. Otherwise returns null.
customParentClass String?
Class that added to data class as implementation
dartTypeName String
The name for the data class associated with this table
dbGetterName String
The getter name used for this table in a generated database or dao class.
read-only, override
declaration TableDeclaration?
Gets the declaration of this element, if set.
displayName String
A human readable name of this entity, like the table name.
read-only, override
dslName String
The name of the Dart class storing the right column getters for this type.
read-only, override
entityInfoName String
The name of the Dart class storing additional properties like type converters.
read-only, override
existingRowClass ExistingRowClass?
The existing class designed to hold a row, if there is any.
fromClass ClassElement?
The ClassElement for the class that declares this table or null if the table was inferred from a CREATE TABLE statement.
fullPrimaryKey Set<MoorColumn>
The primary key for this table.
hasExistingRowClass bool
Whether this table has an existing row class, meaning that moor doesn't have to generate one on its own.
read-only, inherited
hashCode int
The hash code for this object.
read-only, inherited
isFromSql bool
Whether this table was created from an CREATE TABLE statement instead of a Dart class.
isStrict bool
Whether this table is defined as STRICT. Support for strict tables has been added in sqlite 3.37.
isVirtualTable bool
Returns whether this table was created from a CREATE VIRTUAL TABLE statement in a moor file
overrideDontWriteConstraints bool?
When non-null, the generated table class will override the dontWriteConstraint getter on the table class with this value.
overrideTableConstraints List<String>?
When non-null, the generated table class will override the customConstraints getter in the table class with this value.
overrideWithoutRowId bool?
When non-null, the generated table class will override the withoutRowId getter on the table class with this value.
parserTable Table?
The associated table to use for the sqlparser package when analyzing sql queries. Note that this field is set lazily.
read / write
primaryKey Set<MoorColumn>?
The set of primary keys, if they have been explicitly defined by overriding primaryKey in the table class. null if the primary key has not been defined that way.
references Set<MoorTable>
All entities that have to be created before this entity can be created.
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
sqlName String
The (unescaped) name of this table when stored in the database
uniqueKeys List<Set<MoorColumn>>?
The set of unique keys if they have been explicitly defined by overriding uniqueKeys in the table class.


dartTypeCode([GenerationOptions options = const GenerationOptions()]) String
The type name of the Dart row class for this result set.
getNameForCompanionClass(MoorOptions options) String
isColumnRequiredForInsert(MoorColumn column) bool
Determines whether column would be required for inserts performed via companions.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
toString() String
A string representation of this object.


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