TableScheme class
A generic table scheme.
Constructors
-
TableScheme(String name, {required String? idFieldName, required Map<
String, Type> fieldsTypes, Map<String, TableFieldReference> fieldsReferencedTables = const <String, TableFieldReference>{}, Iterable<TableRelationshipReference> ? relationshipTables, Iterable<TableConstraint> ? constraints, bool relationship = false, Map<String, List< ? indexes, Iterable<String> >String> ? uniqueIndexes, Map<String, TableEnumConstraint> ? checkConstraints, String? primaryKeyIndex, Map<String, String> ? indexesKinds})
Properties
-
checkConstraints
→ Map<
String, TableEnumConstraint> ? -
The table's enum
CHECKconstraints, by constraint name;nullif unknown (the adapter doesn't provide them). Unlike constraints, two over the same column aren't merged.final -
constraints
→ Set<
TableConstraint> -
Table constraints.
final
-
duplicatedCheckConstraints
→ Map<
String, List< ?String> > -
The checkConstraints over the same column (case insensitive): by
column, the constraints names (sorted).
nullif the checkConstraints are unknown.no setter -
duplicatedIndexes
→ List<
List< ?String> > -
The indexes over the same columns (in the same order, case
insensitive) and of the same kind (indexesKinds): each group's names
sorted, the groups by their first name.
nullif the indexes are unknown.no setter -
fieldsNames
→ List<
String> -
Table fields names.
final
-
fieldsReferencedTables
→ Map<
String, TableFieldReference> -
no setter
- fieldsReferencedTablesLength → int
-
Returns
_fieldsReferencedTableslength.no setter -
fieldsTypes
→ Map<
String, Type> -
Fields types.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasTableReferences → bool
-
no setter
- idFieldName → String?
-
The ID field name.
final
-
indexes
→ Map<
String, List< ?String> > -
The table's indexes: by index name, its columns (in order);
nullif unknown (the adapter doesn't provide them).final -
indexesKinds
→ Map<
String, String> ? -
How each of the indexes indexes its columns, by index name: an
adapter's description (e.g. the method, operator classes, order,
INCLUDEcolumns), only compared for equality. Indexes over the same columns of different kinds (e.g. a btree and a GIN index) aren't duplicates.null(or an index without one): unknown, a plain index.final - name → String
-
The table name
final
- primaryKeyIndex → String?
-
The name of the index of the primary key (of the indexes);
nullif unknown or none.final - relationship → bool
-
If
trueis a relationship table.final -
relationshipTables
→ Set<
TableRelationshipReference> -
no setter
- relationshipTablesLength → int
-
Returns
_relationshipTableslength.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
tableRelationshipReference
→ Map<
String, List< TableRelationshipReference> > -
Returns
_tableRelationshipReference.no setter - tableRelationshipReferenceLength → int
-
Returns
_tableRelationshipReferencelength.no setter -
uniqueIndexes
→ Set<
String> ? -
The names of the unique indexes (also the ones of
UNIQUEandPRIMARY KEYconstraints);nullif unknown.final
Methods
-
buildFieldsNamesIndexes(
List< String> fieldsNames) → Map<String, int> -
inherited
-
buildFieldsNamesLC(
List< String> fieldsNames) → List<String> -
inherited
-
buildFieldsNamesSimple(
List< String> fieldsNames) → List<String> -
inherited
-
fieldToLCKey(
String key) → String -
inherited
-
fieldToSimpleKey(
String key) → String -
inherited
-
getFieldKeyInMap(
String field, Map< String, Object?> map, {String? fieldLC, String? fieldSimple, Map<String, String> ? mapLC, Map<String, String> ? mapSimple}) → String? -
Returns a
fieldkey frommap.inherited -
getFieldReferencedTable(
String fieldKey) → TableFieldReference? -
Returns a TableFieldReference from
_fieldsReferencedTableswith a resolvedfieldKey. See resolveTableFieldName. -
getFieldsKeysInMap(
List< String> fields, Map<String, Object?> map, {String? fieldLC, String? fieldSimple, Map<String, String> ? mapLC, Map<String, String> ? mapSimple}) → Map<String, String?> -
Returns a Map of
fieldkeys frommap.inherited -
getFieldsValues(
Map< String, Object?> map, {Iterable<String> ? fields}) → Map<String, Object?> -
Returns a Map with the table fields values populated from the provided
map. -
getFieldsValuesFromMap(
List< String> fieldsNames, Map<String, Object?> map, {Map<String, int> ? fieldsNamesIndexes, List<String> ? fieldsNamesLC, List<String> ? fieldsNamesSimple, bool includeAbsentFields = false, List<String> ? returnMapUsedKeys}) → Map<String, Object?> -
Returns a Map with the fields values populated from the provided
map.inherited -
getFieldValueFromMap(
String field, Map< String, Object?> map, {String? fieldLC, String? fieldSimple, Map<String, String> ? mapLC, Map<String, String> ? mapSimple}) → Object? -
Returns a
fieldvalue frommap.inherited -
getTableRelationshipReference(
{String? sourceTable, String? sourceField, String? targetTable}) → TableRelationshipReference? -
Returns the TableRelationshipReference with the
targetTable. -
hasIndexOn(
List< String> columns, {bool unique = false}) → bool? -
Whether the table has an index over exactly
columns(in this order, any name), a unique one ifunique.nullif the indexes (or the uniqueIndexes) are unknown. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
resolveFiledName(
List< String> fieldsNames, String fieldName, {Map<String, int> ? fieldsNamesIndexes, List<String> ? fieldsNamesLC, List<String> ? fieldsNamesSimple, bool includeAbsentFields = false, List<String> ? returnMapUsedKeys}) → String? -
Resolves
fieldNameto one that matches afieldsNameselement.inherited -
resolveTableFieldName(
String key) → String? -
Resolves
keyto a matching field in fieldsNames. -
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited