Fixed dependencies
This commit is contained in:
parent
d31a07bbab
commit
0b109cadfe
5 changed files with 26 additions and 10 deletions
|
@ -1,8 +1,13 @@
|
||||||
# Change Log
|
# Change Log
|
||||||
|
|
||||||
|
## 8.2.2
|
||||||
|
|
||||||
|
* Fixed examples and test cases
|
||||||
|
|
||||||
## 8.2.1
|
## 8.2.1
|
||||||
|
|
||||||
* Updated dependencies
|
* Updated dependencies
|
||||||
|
* Updated `popstgres` to 3.0.0
|
||||||
|
|
||||||
## 8.2.0
|
## 8.2.0
|
||||||
|
|
||||||
|
|
|
@ -3,12 +3,18 @@ import 'dart:io';
|
||||||
import 'package:angel3_orm_postgres/angel3_orm_postgres.dart';
|
import 'package:angel3_orm_postgres/angel3_orm_postgres.dart';
|
||||||
import 'package:postgres/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',
|
username: Platform.environment['POSTGRES_USERNAME'] ?? 'postgres',
|
||||||
password: Platform.environment['POSTGRES_PASSWORD'] ?? 'password');
|
password: Platform.environment['POSTGRES_PASSWORD'] ?? 'password'));
|
||||||
|
}
|
||||||
|
|
||||||
Future<PostgreSqlExecutor> connect() async {
|
Future<PostgreSqlExecutor> connect() async {
|
||||||
|
final conn = await dbConnection();
|
||||||
|
|
||||||
var executor = PostgreSqlExecutor(conn);
|
var executor = PostgreSqlExecutor(conn);
|
||||||
await conn.open();
|
|
||||||
return executor;
|
return executor;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,9 @@ import 'package:angel3_migration_runner/postgres.dart';
|
||||||
import 'connect.dart';
|
import 'connect.dart';
|
||||||
import 'todo.dart';
|
import 'todo.dart';
|
||||||
|
|
||||||
Future main(List<String> args) {
|
Future main(List<String> args) async {
|
||||||
|
final conn = await dbConnection();
|
||||||
|
|
||||||
var runner = PostgresMigrationRunner(conn, migrations: [
|
var runner = PostgresMigrationRunner(conn, migrations: [
|
||||||
TodoMigration(),
|
TodoMigration(),
|
||||||
]);
|
]);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
name: angel3_orm_service
|
name: angel3_orm_service
|
||||||
version: 8.2.1
|
version: 8.2.2
|
||||||
description: Service implementation that wraps over Angel3 ORM Query classes.
|
description: Service implementation that wraps over Angel3 ORM Query classes.
|
||||||
homepage: https://angel3-framework.web.app/
|
homepage: https://angel3-framework.web.app/
|
||||||
repository: https://github.com/dart-backend/angel/tree/master/packages/orm/angel_orm_service
|
repository: https://github.com/dart-backend/angel/tree/master/packages/orm/angel_orm_service
|
||||||
|
|
|
@ -14,16 +14,19 @@ void main() {
|
||||||
late Service<int?, Pokemon> pokemonService;
|
late Service<int?, Pokemon> pokemonService;
|
||||||
|
|
||||||
setUp(() async {
|
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',
|
username: Platform.environment['POSTGRES_USERNAME'] ?? 'postgres',
|
||||||
password: Platform.environment['POSTGRES_PASSWORD'] ?? 'password');
|
password: Platform.environment['POSTGRES_PASSWORD'] ?? 'password'));
|
||||||
hierarchicalLoggingEnabled = true;
|
hierarchicalLoggingEnabled = true;
|
||||||
logger = Logger.detached('orm_service');
|
logger = Logger.detached('orm_service');
|
||||||
logger.level = Level.ALL;
|
logger.level = Level.ALL;
|
||||||
if (Platform.environment['log'] == '1') logger.onRecord.listen(print);
|
if (Platform.environment['log'] == '1') logger.onRecord.listen(print);
|
||||||
executor = PostgreSqlExecutor(conn, logger: logger);
|
executor = PostgreSqlExecutor(conn, logger: logger);
|
||||||
await conn.open();
|
|
||||||
await conn.query('''
|
await conn.execute('''
|
||||||
CREATE TEMPORARY TABLE pokemons (
|
CREATE TEMPORARY TABLE pokemons (
|
||||||
id serial,
|
id serial,
|
||||||
species varchar,
|
species varchar,
|
||||||
|
|
Loading…
Reference in a new issue