Skip to content

Commit

Permalink
chore(version): 3.0.0-beta.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Seven Du committed Feb 17, 2023
1 parent 4524256 commit 70228ff
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
18 changes: 15 additions & 3 deletions bin/generator/generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -744,9 +744,21 @@ extension ModelFluentGenerator on Generator {
return [query.returned];
}

final type = _modelDelegateMethodReturnTypeBuilder(field);
final query =
code.refer('query').call([code.literalConstList([])]).asA(type);
final type = scalar(field.outputType);
final fn = code.Method((updates) {
updates.requiredParameters.add(code.Parameter((updates) {
updates.name = 'value';
}));

updates.body = code.refer('value').asA(type).code;
updates.lambda = true;
});

final query = code
.refer('query')
.call([code.literalConstList([])])
.property('then')
.call([fn.closure]);

return [query.returned];
}
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: orm
description: ◭ Next-generation ORM for Dart & Flutter | PostgreSQL, MySQL, MariaDB, SQL Server, SQLite, MongoDB and CockroachDB.
version: 3.0.0-alpha.0
version: 3.0.0-beta.1
homepage: https://prisma.pub
repository: https://github.com/odroe/prisma-dart
funding:
Expand Down
4 changes: 4 additions & 0 deletions test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ void main() async {

final aggregate = prisma.user.aggregate();
print(await aggregate.$count().id());
print(await aggregate.$avg().id());
print(await aggregate.$min().name());
print(await aggregate.$max().role());
print(await aggregate.$max().createdAt());
} finally {
await prisma.$disconnect();
}
Expand Down

1 comment on commit 70228ff

@vercel
Copy link

@vercel vercel bot commented on 70228ff Feb 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.