diff --git a/packages/orm/angel_orm_service/CHANGELOG.md b/packages/orm/angel_orm_service/CHANGELOG.md index 5e4a43ad..2b383d67 100644 --- a/packages/orm/angel_orm_service/CHANGELOG.md +++ b/packages/orm/angel_orm_service/CHANGELOG.md @@ -1,8 +1,13 @@ # Change Log +## 8.2.2 + +* Fixed examples and test cases + ## 8.2.1 * Updated dependencies +* Updated `popstgres` to 3.0.0 ## 8.2.0 diff --git a/packages/orm/angel_orm_service/example/connect.dart b/packages/orm/angel_orm_service/example/connect.dart index f10f3967..abe59baf 100644 --- a/packages/orm/angel_orm_service/example/connect.dart +++ b/packages/orm/angel_orm_service/example/connect.dart @@ -3,12 +3,18 @@ import 'dart:io'; import 'package:angel3_orm_postgres/angel3_orm_postgres.dart'; import 'package:postgres/postgres.dart'; -final conn = PostgreSQLConnection('localhost', 5432, 'angel_orm_service_test', - username: Platform.environment['POSTGRES_USERNAME'] ?? 'postgres', - password: Platform.environment['POSTGRES_PASSWORD'] ?? 'password'); +Future dbConnection() async { + return Connection.open(Endpoint( + host: 'localhost', + port: 5432, + database: 'angel_orm_service_test', + username: Platform.environment['POSTGRES_USERNAME'] ?? 'postgres', + password: Platform.environment['POSTGRES_PASSWORD'] ?? 'password')); +} Future connect() async { + final conn = await dbConnection(); + var executor = PostgreSqlExecutor(conn); - await conn.open(); return executor; } diff --git a/packages/orm/angel_orm_service/example/migrate.dart b/packages/orm/angel_orm_service/example/migrate.dart index 9422c555..ba7ee8a0 100644 --- a/packages/orm/angel_orm_service/example/migrate.dart +++ b/packages/orm/angel_orm_service/example/migrate.dart @@ -3,7 +3,9 @@ import 'package:angel3_migration_runner/postgres.dart'; import 'connect.dart'; import 'todo.dart'; -Future main(List args) { +Future main(List args) async { + final conn = await dbConnection(); + var runner = PostgresMigrationRunner(conn, migrations: [ TodoMigration(), ]); diff --git a/packages/orm/angel_orm_service/pubspec.yaml b/packages/orm/angel_orm_service/pubspec.yaml index ca490d8b..688fc070 100644 --- a/packages/orm/angel_orm_service/pubspec.yaml +++ b/packages/orm/angel_orm_service/pubspec.yaml @@ -1,5 +1,5 @@ name: angel3_orm_service -version: 8.2.1 +version: 8.2.2 description: Service implementation that wraps over Angel3 ORM Query classes. homepage: https://angel3-framework.web.app/ repository: https://github.com/dart-backend/angel/tree/master/packages/orm/angel_orm_service diff --git a/packages/orm/angel_orm_service/test/all_test.dart b/packages/orm/angel_orm_service/test/all_test.dart index 8557d17c..833d35f2 100644 --- a/packages/orm/angel_orm_service/test/all_test.dart +++ b/packages/orm/angel_orm_service/test/all_test.dart @@ -14,16 +14,19 @@ void main() { late Service pokemonService; setUp(() async { - var conn = PostgreSQLConnection('localhost', 5432, 'angel_orm_service_test', + var conn = await Connection.open(Endpoint( + host: 'localhost', + port: 5432, + database: 'angel_orm_service_test', username: Platform.environment['POSTGRES_USERNAME'] ?? 'postgres', - password: Platform.environment['POSTGRES_PASSWORD'] ?? 'password'); + password: Platform.environment['POSTGRES_PASSWORD'] ?? 'password')); hierarchicalLoggingEnabled = true; logger = Logger.detached('orm_service'); logger.level = Level.ALL; if (Platform.environment['log'] == '1') logger.onRecord.listen(print); executor = PostgreSqlExecutor(conn, logger: logger); - await conn.open(); - await conn.query(''' + + await conn.execute(''' CREATE TEMPORARY TABLE pokemons ( id serial, species varchar,