TableDefinition class abstract

The definition of a (desired) table in the database.

Implemented types
Available extensions

Constructors

TableDefinition({required String name, String? dartName, String? module, required String schema, String? tableSpace, required List<ColumnDefinition> columns, required List<ForeignKeyDefinition> foreignKeys, required List<IndexDefinition> indexes, bool? managed})
factory
TableDefinition.fromJson(Map<String, dynamic> jsonSerialization)
factory

Properties

columns List<ColumnDefinition>
All the columns of this table.
getter/setter pair
dartName String?
The name of the serializable class in Dart.
getter/setter pair
foreignKeys List<ForeignKeyDefinition>
All the foreign keys.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
indexes List<IndexDefinition>
All the indexes of this table.
getter/setter pair
managed bool?
Indicates if the table should be managed by Serverpod. Null, if this is unknown.
getter/setter pair
module String?
The name of the module this table belongs to, if available.
getter/setter pair
name String
The table name.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
schema String
The schema this table is in.
getter/setter pair
tableSpace String?
The tablespace this table is stored in. If null, the table is in the databases default tablespace.
getter/setter pair

Methods

containsColumnNamed(String columnName) bool

Available on TableDefinition, provided by the TableDefinitionUtils extension

Returns true if the table contains a column with the given columnName.
containsForeignKeyNamed(String keyName) bool

Available on TableDefinition, provided by the TableDefinitionUtils extension

Returns true if the table contains a foreign key with the given keyName.
containsIndexNamed(String indexName) bool

Available on TableDefinition, provided by the TableDefinitionUtils extension

Returns true if the table contains an index with the given indexName.
copyWith({String? name, String? dartName, String? module, String? schema, String? tableSpace, List<ColumnDefinition>? columns, List<ForeignKeyDefinition>? foreignKeys, List<IndexDefinition>? indexes, bool? managed}) TableDefinition
Returns a shallow copy of this TableDefinition with some or all fields replaced by the given arguments.
findColumnNamed(String columnName) ColumnDefinition?

Available on TableDefinition, provided by the TableDefinitionUtils extension

Finds a column by its name, or returns null if no column with the given name is found.
findForeignKeyDefinitionNamed(String keyName, {bool ignoreCase = false}) ForeignKeyDefinition?

Available on TableDefinition, provided by the TableDefinitionUtils extension

Finds a foreign key by its name, or returns null if no key with the given name is found.
findIndexNamed(String indexName, {bool ignoreCase = false}) IndexDefinition?

Available on TableDefinition, provided by the TableDefinitionUtils extension

Finds an index by its name, or returns null if no index with the given name is found.
like(TableDefinition other) List<ComparisonWarning<ComparisonWarning>>

Available on TableDefinition, provided by the TableComparisons extension

Compares this table definition with other, returning a list of mismatches.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Returns a serialized JSON structure of the model which also includes fields used by the database.
override
toString() String
A string representation of this object.
override

Operators

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