comon_orm_postgresql 0.0.1-alpha
comon_orm_postgresql: ^0.0.1-alpha copied to clipboard
PostgreSQL adapter for comon_orm with runtime queries, migrations, and schema introspection.
example/main.dart
import 'package:comon_orm_postgresql/comon_orm_postgresql.dart';
import 'generated/comon_orm_client.dart';
Future<void> main() async {
final adapter = await PostgresqlDatabaseAdapter.openAndApplyFromSchemaPath(
schemaPath: 'example/schema.prisma',
);
try {
final client = GeneratedComonOrmClient(adapter: adapter);
final user = await client.user.create(
data: const UserCreateInput(email: 'alice@example.com', name: 'Alice'),
);
print('created: ${user.email}');
} finally {
await adapter.close();
}
}