SchemaRegistry class
Registry that stores model schemas and provides lookup methods.
- Available extensions
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
-
modelNames
→ List<
String> -
Get all registered model names.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
clear(
) → void - Clear all registered models (useful for testing).
-
getField(
String modelName, String fieldName) → FieldInfo? - Get field info for a model's field.
-
getModel(
String name) → ModelSchema? - Get a model schema by name.
-
getPrimaryKeys(
String modelName) → List< FieldInfo> - Get the primary key field(s) for a model.
-
getRelation(
String modelName, String fieldName) → RelationInfo? - Get relation info for a model's field.
-
getRelations(
String modelName) → Map< String, RelationInfo> - Get all relations for a model.
-
getTableName(
String modelName) → String? - Get table name for a model.
-
hasModel(
String name) → bool - Check if a model exists.
-
model(
String name, {String? tableName, required Map< String, FieldInfo> fields, Map<String, RelationInfo> relations = const {}}) → SchemaRegistry -
Available on SchemaRegistry, provided by the SchemaRegistryBuilder extension
Fluent API for registering a model. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerModel(
ModelSchema schema) → void - Register a model schema.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited