Skip to content

Commit

Permalink
TableSchema | Field
Browse files Browse the repository at this point in the history
  • Loading branch information
a-givertzman committed Dec 14, 2024
1 parent 6a655e0 commit 1c186cf
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 14 deletions.
2 changes: 1 addition & 1 deletion lib/src/table_schema/relation_schema.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class RelationSchema<T extends SchemaEntryAbstract, P> implements TableSchemaAbs
///
/// Returns a list of table field names
@override
List<Field> get fields {
List<Field<T>> get fields {
return _schema.fields;
}
///
Expand Down
6 changes: 3 additions & 3 deletions lib/src/table_schema/table_schema.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import 'package:hmi_core/hmi_core_result.dart';
/// abstruction on the SQL table rows
class TableSchema<T extends SchemaEntryAbstract, P> implements TableSchemaAbstract<T, P> {
late final Log _log;
final List<Field> _fields;
final List<Field<T>> _fields;
final Map<String, T> _entries = {};
final SchemaRead<T, P> _read;
final SchemaWrite<T> _write;
Expand All @@ -17,7 +17,7 @@ class TableSchema<T extends SchemaEntryAbstract, P> implements TableSchemaAbstra
/// abstruction on the SQL table rows
/// - [keys] - list of table field names
TableSchema({
required List<Field> fields,
required List<Field<T>> fields,
SchemaRead<T, P> read = const SchemaRead.empty(),
SchemaWrite<T> write = const SchemaWrite.empty(),
}) :
Expand All @@ -29,7 +29,7 @@ class TableSchema<T extends SchemaEntryAbstract, P> implements TableSchemaAbstra
///
/// Returns a list of table field names
@override
List<Field> get fields {
List<Field<T>> get fields {
return _fields;
}
///
Expand Down
2 changes: 1 addition & 1 deletion lib/src/table_schema/table_schema_abstract.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import 'package:hmi_core/hmi_core_result.dart';
abstract interface class TableSchemaAbstract<T extends SchemaEntryAbstract, P> implements Schema<T, P> {
///
/// Returns a list of table fields
List<Field> get fields;
List<Field<T>> get fields;
///
/// Returns a list of table field keys
List<String> get keys;
Expand Down
13 changes: 4 additions & 9 deletions lib/src/table_schema/table_schema_filtered.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class TableSchemaFiltered<T extends SchemaEntryAbstract, P> implements TableSche
///
/// Returns a list of table field names
@override
List<Field> get fields {
List<Field<T>> get fields {
return _schema.fields;
}
///
Expand Down Expand Up @@ -100,17 +100,12 @@ class TableSchemaFiltered<T extends SchemaEntryAbstract, P> implements TableSche
//
//
@override
Map<String, List<SchemaEntryAbstract>> get relations {
return {};
}
Map<String, List<SchemaEntryAbstract>> get relations => _schema.relations;
//
//
@override
Result<TableSchemaFiltered<SchemaEntry, dynamic>, Failure> relation(String id) {
return Err(Failure(
message: '$runtimeType.relation | method does not exists',
stackTrace: StackTrace.current,
));
Result<TableSchemaAbstract<SchemaEntryAbstract, dynamic>, Failure> relation(String id) {
return _schema.relation(id);
}
//
//
Expand Down

0 comments on commit 1c186cf

Please sign in to comment.