Updated orm postgres

This commit is contained in:
thomashii 2021-07-25 21:50:39 +08:00
parent 3eeefa7916
commit b670a08ae3
2 changed files with 6 additions and 10 deletions

View file

@ -14,9 +14,5 @@ dev_dependencies:
angel3_pretty_logging: ^3.0.0
test: ^1.17.0
pedantic: ^1.11.0
angel3_orm_test:
git:
url: https://github.com/dukefirehawk/angel.git
ref: angel3
path: packages/orm/angel_orm_test
angel3_orm_test: ^3.0.0

View file

@ -6,7 +6,7 @@ import 'models/custom_expr.dart';
void customExprTests(FutureOr<QueryExecutor> Function() createExecutor,
{FutureOr<void> Function(QueryExecutor)? close}) {
late QueryExecutor executor;
Numbers? numbersModel;
late Numbers numbersModel;
close ??= (_) => null;
@ -27,16 +27,16 @@ void customExprTests(FutureOr<QueryExecutor> Function() createExecutor,
tearDown(() => close!(executor));
test('fetches correct result', () async {
expect(numbersModel?.two, 2);
expect(numbersModel.two, 2);
});
test('in relation', () async {
var abcQuery = AlphabetQuery();
abcQuery.values
..value = 'abc'
..numbersId = numbersModel!.idAsInt
..createdAt = numbersModel!.createdAt
..updatedAt = numbersModel!.updatedAt;
..numbersId = numbersModel.idAsInt
..createdAt = numbersModel.createdAt
..updatedAt = numbersModel.updatedAt;
var abcOpt = await (abcQuery.insert(executor));
expect(abcOpt.isPresent, true);
abcOpt.ifPresent((abc) {