diff --git a/angel_orm/lib/src/join_on.dart b/angel_orm/lib/src/join_on.dart index acf3ee11..7bfed401 100644 --- a/angel_orm/lib/src/join_on.dart +++ b/angel_orm/lib/src/join_on.dart @@ -5,4 +5,4 @@ class JoinOn { final SqlExpressionBuilder value; JoinOn(this.key, this.value); -} \ No newline at end of file +} diff --git a/angel_orm/lib/src/query_executor.dart b/angel_orm/lib/src/query_executor.dart index ec6448c0..85474365 100644 --- a/angel_orm/lib/src/query_executor.dart +++ b/angel_orm/lib/src/query_executor.dart @@ -16,7 +16,7 @@ abstract class QueryExecutor { /// /// If [f] fails, the transaction will be rolled back, and the /// responsible exception will be re-thrown. - /// + /// /// Whether nested transactions are supported depends on the /// underlying driver. Future transaction(FutureOr Function(QueryExecutor) f); diff --git a/angel_orm/lib/src/query_values.dart b/angel_orm/lib/src/query_values.dart index 566ad8e2..368cc8c6 100644 --- a/angel_orm/lib/src/query_values.dart +++ b/angel_orm/lib/src/query_values.dart @@ -56,4 +56,4 @@ abstract class QueryValues { } return b.toString(); } -} \ No newline at end of file +} diff --git a/angel_orm_mysql/example/main.g.dart b/angel_orm_mysql/example/main.g.dart index f35cf8fe..56bcf3e1 100644 --- a/angel_orm_mysql/example/main.g.dart +++ b/angel_orm_mysql/example/main.g.dart @@ -153,7 +153,7 @@ class TodoQueryValues extends MapQueryValues { class Todo extends _Todo { Todo( {this.id, - @required this.isComplete = false, + this.isComplete = false, this.text, this.createdAt, this.updatedAt}); diff --git a/angel_orm_mysql/lib/angel_orm_mysql.dart b/angel_orm_mysql/lib/angel_orm_mysql.dart index 50ac6521..fdda00d8 100644 --- a/angel_orm_mysql/lib/angel_orm_mysql.dart +++ b/angel_orm_mysql/lib/angel_orm_mysql.dart @@ -2,7 +2,7 @@ import 'dart:async'; import 'package:angel_orm/angel_orm.dart'; import 'package:angel_orm/src/query.dart'; import 'package:logging/logging.dart'; -import 'package:pool/pool.dart'; +// import 'package:pool/pool.dart'; import 'package:sqljocky5/connection/connection.dart'; import 'package:sqljocky5/sqljocky.dart'; diff --git a/angel_orm_mysql/pubspec.yaml b/angel_orm_mysql/pubspec.yaml index d7b92dcf..2beabb75 100644 --- a/angel_orm_mysql/pubspec.yaml +++ b/angel_orm_mysql/pubspec.yaml @@ -17,4 +17,7 @@ dev_dependencies: angel_orm_test: path: ../angel_orm_test build_runner: ^1.0.0 - test: ^1.0.0 \ No newline at end of file + test: ^1.0.0 +dependency_overrides: + angel_migration: + path: ../angel_migration \ No newline at end of file diff --git a/angel_orm_service/example/todo.g.dart b/angel_orm_service/example/todo.g.dart index a99cfd4d..6ac25846 100644 --- a/angel_orm_service/example/todo.g.dart +++ b/angel_orm_service/example/todo.g.dart @@ -179,7 +179,7 @@ class Todo extends _Todo { String text, DateTime createdAt, DateTime updatedAt}) { - return new Todo( + return Todo( id: id ?? this.id, isComplete: isComplete ?? this.isComplete, text: text ?? this.text, @@ -215,7 +215,7 @@ class Todo extends _Todo { // SerializerGenerator // ************************************************************************** -const TodoSerializer todoSerializer = const TodoSerializer(); +const TodoSerializer todoSerializer = TodoSerializer(); class TodoEncoder extends Converter { const TodoEncoder(); @@ -240,10 +240,10 @@ class TodoSerializer extends Codec { get decoder => const TodoDecoder(); static Todo fromMap(Map map) { if (map['text'] == null) { - throw new FormatException("Missing required field 'text' on Todo."); + throw FormatException("Missing required field 'text' on Todo."); } - return new Todo( + return Todo( id: map['id'] as String, isComplete: map['is_complete'] as bool ?? false, text: map['text'] as String, @@ -264,7 +264,7 @@ class TodoSerializer extends Codec { return null; } if (model.text == null) { - throw new FormatException("Missing required field 'text' on Todo."); + throw FormatException("Missing required field 'text' on Todo."); } return { diff --git a/angel_orm_service/lib/angel_orm_service.dart b/angel_orm_service/lib/angel_orm_service.dart index 4e6ab6b1..e3b6c57d 100644 --- a/angel_orm_service/lib/angel_orm_service.dart +++ b/angel_orm_service/lib/angel_orm_service.dart @@ -67,9 +67,9 @@ class OrmService> if (v is Map) { v.forEach((key, value) { var descending = false; - if (value is String) + if (value is String) { descending = value == '-1'; - else if (value is num) descending = value.toInt() == -1; + } else if (value is num) descending = value.toInt() == -1; query.orderBy(key.toString(), descending: descending); }); } else if (v is String) { @@ -120,8 +120,7 @@ class OrmService> await _applyQuery(query, params); var result = await query.getOne(executor); if (result != null) return result; - throw new AngelHttpException.notFound( - message: 'No record found for ID $id'); + throw AngelHttpException.notFound(message: 'No record found for ID $id'); } @override @@ -133,7 +132,7 @@ class OrmService> await _applyQuery(query, params); var result = await query.getOne(executor); if (result != null) return result; - throw new AngelHttpException.notFound(message: errorMessage); + throw AngelHttpException.notFound(message: errorMessage); } @override @@ -170,8 +169,7 @@ class OrmService> var result = await query.updateOne(executor); if (result != null) return result; - throw new AngelHttpException.notFound( - message: 'No record found for ID $id'); + throw AngelHttpException.notFound(message: 'No record found for ID $id'); } @override @@ -192,7 +190,6 @@ class OrmService> var result = await query.deleteOne(executor); if (result != null) return result; - throw new AngelHttpException.notFound( - message: 'No record found for ID $id'); + throw AngelHttpException.notFound(message: 'No record found for ID $id'); } } diff --git a/angel_orm_service/pubspec.yaml b/angel_orm_service/pubspec.yaml index 40607677..9ef79e75 100644 --- a/angel_orm_service/pubspec.yaml +++ b/angel_orm_service/pubspec.yaml @@ -23,4 +23,7 @@ dev_dependencies: logging: ^0.11.0 pedantic: ^1.0.0 postgres: ^1.0.0 - test: ^1.0.0 \ No newline at end of file + test: ^1.0.0 +dependency_overrides: + angel_migration: + path: ../angel_migration \ No newline at end of file diff --git a/angel_orm_service/test/pokemon.g.dart b/angel_orm_service/test/pokemon.g.dart index d6e49ed9..aa769e33 100644 --- a/angel_orm_service/test/pokemon.g.dart +++ b/angel_orm_service/test/pokemon.g.dart @@ -238,7 +238,7 @@ class Pokemon extends _Pokemon { PokemonType type2, DateTime createdAt, DateTime updatedAt}) { - return new Pokemon( + return Pokemon( id: id ?? this.id, species: species ?? this.species, name: name ?? this.name, @@ -281,7 +281,7 @@ class Pokemon extends _Pokemon { // SerializerGenerator // ************************************************************************** -const PokemonSerializer pokemonSerializer = const PokemonSerializer(); +const PokemonSerializer pokemonSerializer = PokemonSerializer(); class PokemonEncoder extends Converter { const PokemonEncoder(); @@ -306,18 +306,18 @@ class PokemonSerializer extends Codec { get decoder => const PokemonDecoder(); static Pokemon fromMap(Map map) { if (map['species'] == null) { - throw new FormatException("Missing required field 'species' on Pokemon."); + throw FormatException("Missing required field 'species' on Pokemon."); } if (map['level'] == null) { - throw new FormatException("Missing required field 'level' on Pokemon."); + throw FormatException("Missing required field 'level' on Pokemon."); } if (map['type1'] == null) { - throw new FormatException("Missing required field 'type1' on Pokemon."); + throw FormatException("Missing required field 'type1' on Pokemon."); } - return new Pokemon( + return Pokemon( id: map['id'] as String, species: map['species'] as String, name: map['name'] as String, @@ -349,15 +349,15 @@ class PokemonSerializer extends Codec { return null; } if (model.species == null) { - throw new FormatException("Missing required field 'species' on Pokemon."); + throw FormatException("Missing required field 'species' on Pokemon."); } if (model.level == null) { - throw new FormatException("Missing required field 'level' on Pokemon."); + throw FormatException("Missing required field 'level' on Pokemon."); } if (model.type1 == null) { - throw new FormatException("Missing required field 'type1' on Pokemon."); + throw FormatException("Missing required field 'type1' on Pokemon."); } return { diff --git a/angel_orm_test/lib/src/models/has_car.dart b/angel_orm_test/lib/src/models/has_car.dart index 6e7a7c8e..6a6e6b64 100644 --- a/angel_orm_test/lib/src/models/has_car.dart +++ b/angel_orm_test/lib/src/models/has_car.dart @@ -2,13 +2,12 @@ import 'package:angel_migration/angel_migration.dart'; import 'package:angel_model/angel_model.dart'; import 'package:angel_orm/angel_orm.dart'; import 'package:angel_serialize/angel_serialize.dart'; -import 'package:meta/meta.dart'; -import 'car.dart'; +// import 'car.dart'; part 'has_car.g.dart'; -Map _carToMap(Car car) => car.toJson(); +// Map _carToMap(Car car) => car.toJson(); -Car _carFromMap(map) => CarSerializer.fromMap(map as Map); +// Car _carFromMap(map) => CarSerializer.fromMap(map as Map); enum CarType { sedan, suv, atv } diff --git a/angel_orm_test/lib/src/models/has_map.dart b/angel_orm_test/lib/src/models/has_map.dart index 8414de94..f98de5a7 100644 --- a/angel_orm_test/lib/src/models/has_map.dart +++ b/angel_orm_test/lib/src/models/has_map.dart @@ -5,8 +5,8 @@ import 'package:angel_serialize/angel_serialize.dart'; import 'package:collection/collection.dart'; part 'has_map.g.dart'; -String _boolToCustom(bool v) => v ? 'yes' : 'no'; -bool _customToBool(v) => v == 'yes'; +// String _boolToCustom(bool v) => v ? 'yes' : 'no'; +// bool _customToBool(v) => v == 'yes'; @orm @serializable