DatabaseDefinition class abstract
Defines the structure of the database used by Serverpod.
- Implemented types
- Available extensions
Constructors
-
DatabaseDefinition({int? schemaVersion, String? name, required String moduleName, required List<
TableDefinition> tables, required List<DatabaseMigrationVersionModel> installedModules, required int migrationApiVersion}) -
factory
-
DatabaseDefinition.fromJson(Map<
String, dynamic> jsonSerialization) -
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
-
installedModules
↔ List<
DatabaseMigrationVersionModel> -
Modules installed in the database, together with their version. Only
set if known.
getter/setter pair
- migrationApiVersion ↔ int
-
The version of the database definition.
getter/setter pair
- moduleName ↔ String
-
The name of the module that defines the database.
getter/setter pair
- name ↔ String?
-
The name of the database.
Null if the name is not available.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- schemaVersion ↔ int
-
Schema version of the definition format.
getter/setter pair
-
tables
↔ List<
TableDefinition> -
The tables of the database.
getter/setter pair
Methods
-
containsTableNamed(
String tableName) → bool -
Available on DatabaseDefinition, provided by the DatabaseDefinitionUtils extension
Returns true if the database contains a table with the giventableName. -
copyWith(
{int? schemaVersion, String? name, String? moduleName, List< TableDefinition> ? tables, List<DatabaseMigrationVersionModel> ? installedModules, int? migrationApiVersion}) → DatabaseDefinition - Returns a shallow copy of this DatabaseDefinition with some or all fields replaced by the given arguments.
-
findTableNamed(
String tableName) → TableDefinition? -
Available on DatabaseDefinition, provided by the DatabaseDefinitionUtils extension
Finds a table by its name, or returns null if no table with the given name. -
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