Fixed dependencies

This commit is contained in:
Thomas Hii 2024-06-23 18:02:36 +08:00
parent d31a07bbab
commit 0b109cadfe
5 changed files with 26 additions and 10 deletions

View file

@ -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

View file

@ -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',
Future<Connection> 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');
password: Platform.environment['POSTGRES_PASSWORD'] ?? 'password'));
}
Future<PostgreSqlExecutor> connect() async {
final conn = await dbConnection();
var executor = PostgreSqlExecutor(conn);
await conn.open();
return executor;
}

View file

@ -3,7 +3,9 @@ import 'package:angel3_migration_runner/postgres.dart';
import 'connect.dart';
import 'todo.dart';
Future main(List<String> args) {
Future main(List<String> args) async {
final conn = await dbConnection();
var runner = PostgresMigrationRunner(conn, migrations: [
TodoMigration(),
]);

View file

@ -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

View file

@ -14,16 +14,19 @@ void main() {
late Service<int?, Pokemon> 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,