orm 4.0.0-alpha.1 orm: ^4.0.0-alpha.1 copied to clipboard
◭ Next-generation ORM for Dart & Flutter | PostgreSQL, MySQL, MariaDB, SQL Server, SQLite, MongoDB and CockroachDB.
import 'dart:io';
import 'package:orm/orm.dart';
import '../prisma/dart/client.dart';
import '../prisma/dart/prisma.dart';
void main() async {
final prisma = PrismaClient();
try {
final user = await prisma.user.findFirstOrThrow(
select: UserSelect(id: true, name: true, $count: PrismaUnion.$1(true)),
);
print(
'Fond user ${user.name} (ID: ${user.id}), Total posts: ${user.$count?.posts}');
} finally {
await prisma.$disconnect();
exit(0);
}
}