Skip to content

Commit

Permalink
Merge pull request dart-backend#134 from dukefirehawk/bug-fix/upgrade…
Browse files Browse the repository at this point in the history
…_dep

Fixed analyzer warnings
  • Loading branch information
dukefirehawk authored Jun 24, 2024
2 parents b39795b + d57dbae commit 4ceaf7a
Show file tree
Hide file tree
Showing 14 changed files with 33 additions and 38 deletions.
4 changes: 4 additions & 0 deletions packages/orm/angel_orm_generator/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## 8.3.2

* Fixed analyzer warnings

## 8.3.1

* Updated dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ Future<OrmBuildContext?> buildOrmContext(
}
} on StackOverflowError {
throw UnsupportedError(
'There is an infinite cycle between ${clazz.name} and ${field.type.getDisplayString(withNullability: true)}. This triggered a stack overflow.');
'There is an infinite cycle between ${clazz.name} and ${field.type.getDisplayString()}. This triggered a stack overflow.');
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@ class OrmGenerator extends GeneratorForAnnotation<Orm> {
if (const TypeChecker.fromRuntime(int).isExactlyType(type) ||
const TypeChecker.fromRuntime(double).isExactlyType(type) ||
isSpecialId(ctx, field)) {
var typeName = type.getDisplayString(withNullability: false);
var typeName = type.getDisplayString();
if (isSpecialId(ctx, field)) {
typeName = 'int';
}
Expand Down
2 changes: 1 addition & 1 deletion packages/orm/angel_orm_generator/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: angel3_orm_generator
version: 8.3.1
version: 8.3.2
description: Code generators for Angel3 ORM. Generates query builder classes.
homepage: https://angel3-framework.web.app/
repository: https://github.com/dart-backend/angel/tree/master/packages/orm/angel_orm_generator
Expand Down
4 changes: 4 additions & 0 deletions packages/orm/angel_orm_postgres/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## 8.2.2

* Fixed analyzer warnings

## 8.2.1

* Updated dependencies
Expand Down
4 changes: 3 additions & 1 deletion packages/orm/angel_orm_postgres/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@ For documentation about the ORM, see [Developer Guide](https://angel3-docs.dukef

## Migration

Posrgresql is upgraded from 2.x.x to 3.x.x in version 8.1.0.
### From version 7.x to 8.1.x

`postgres` has been upgraded from 2.x.x to 3.x.x since version 8.1.0. This is a breaking change as `postgres` 3.x.x has majorly changed its API. Therefore when upgrading to 8.1.0 and beyond, the PostgreSQL connection settings need to be migrated. The rest should remain the same. Please see the example for the new PostgreSQL connection settings.
4 changes: 1 addition & 3 deletions packages/orm/angel_orm_postgres/lib/src/orm_postgres.dart
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,12 @@ class PostgreSqlExecutor extends QueryExecutor {

var conn = _session as Connection;

return await conn.runTx((session) async {
return await conn.runTx((TxSession session) async {
try {
//logger.fine('Entering transaction');
var exec = PostgreSqlExecutor(session, logger: logger);
return await f(exec);
} catch (e) {
session.rollback();
//ctx.cancelTransaction(reason: e.toString());
logger.warning("The transation has failed due to ", e);
rethrow;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class PostgreSqlPoolExecutor extends QueryExecutor {
}
});

return _pool.run<Result>((session) async {
return _pool.run<Result>((Session session) async {
return await session.execute(Sql.named(query), parameters: param);
});
}
Expand Down
4 changes: 2 additions & 2 deletions packages/orm/angel_orm_postgres/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: angel3_orm_postgres
version: 8.2.1
version: 8.2.2
description: PostgreSQL support for Angel3 ORM. Includes functionality for querying and transactions.
homepage: https://angel3-framework.web.app/
repository: https://github.com/dart-backend/angel/tree/master/packages/orm/angel_orm_postgres
Expand All @@ -9,7 +9,7 @@ dependencies:
angel3_orm: ^8.2.0
logging: ^1.2.0
pool: ^1.5.0
postgres: ^3.0.0
postgres: ^3.2.0
dev_dependencies:
belatuk_pretty_logging: ^6.1.0
angel3_orm_generator: ^8.2.0
Expand Down
2 changes: 1 addition & 1 deletion packages/orm/angel_orm_service/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
## 8.2.1

* Updated dependencies
* Updated `popstgres` to 3.0.0
* [BREAKING] Updated `postgres` to 3.2.0

## 8.2.0

Expand Down
2 changes: 1 addition & 1 deletion packages/orm/angel_orm_service/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ environment:
dependencies:
angel3_framework: ^8.4.0
angel3_orm: ^8.2.0
postgres: ^3.0.0
postgres: ^3.2.0
optional: ^6.0.0
dev_dependencies:
angel3_migration: ^8.2.0
Expand Down
4 changes: 4 additions & 0 deletions packages/orm/angel_orm_test/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## 8.2.1

* Fixed analyzer warnings

## 8.2.0

* Require Dart >= 3.3
Expand Down
21 changes: 2 additions & 19 deletions packages/orm/angel_orm_test/lib/src/many_to_many_test.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'dart:async';
import 'dart:io';
import 'package:angel3_orm/angel3_orm.dart';
import 'package:test/test.dart';
import 'models/user.dart';
Expand All @@ -12,6 +11,7 @@ void manyToManyTests(FutureOr<QueryExecutor> Function() createExecutor,
User? thosakwe;
close ??= (_) => null;

/*
Future<void> dumpQuery(String query) async {
if (Platform.environment.containsKey('STFU')) return;
print('\n');
Expand All @@ -26,28 +26,11 @@ void manyToManyTests(FutureOr<QueryExecutor> Function() createExecutor,
}
print('==================================================\n\n');
}
*/

setUp(() async {
executor = await createExecutor();

// await dumpQuery("""
// WITH roles as
// (INSERT INTO roles (name)
// VALUES ('pyt')
// RETURNING roles.id, roles.name, roles.created_at, roles.updated_at)
// SELECT
// roles.id, roles.name, roles.created_at, roles.updated_at
// FROM roles
// LEFT JOIN
// (SELECT
// role_users.role_id, role_users.user_id,
// a0.id, a0.username, a0.password, a0.email, a0.created_at, a0.updated_at
// FROM role_users
// LEFT JOIN
// users a0 ON role_users.user_id=a0.id)
// a1 ON roles.id=a1.role_id
// """);

var canPubQuery = RoleQuery()..values.name = 'can_pub';
var canSubQuery = RoleQuery()..values.name = 'can_sub';
canPub = (await canPubQuery.insert(executor)).value;
Expand Down
14 changes: 7 additions & 7 deletions packages/orm/angel_orm_test/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
name: angel3_orm_test
version: 8.2.0
version: 8.2.1
description: Common tests for Angel3 ORM. Reference implmentation of the generated ORM files.
homepage: https://angel3-framework.web.app/
repository: https://github.com/dart-backend/angel/tree/master/packages/orm/angel_orm_test
environment:
sdk: '>=3.3.0 <4.0.0'
dependencies:
angel3_migration: ^8.0.0
angel3_model: ^8.0.0
angel3_orm: ^8.0.0
angel3_serialize: ^8.0.0
angel3_migration: ^8.2.0
angel3_model: ^8.2.0
angel3_orm: ^8.2.0
angel3_serialize: ^8.2.0
io: ^1.0.0
test: ^1.24.0
collection: ^1.17.0
optional: ^6.1.0
dev_dependencies:
angel3_orm_generator: ^8.0.0
angel3_framework: ^8.0.0
angel3_orm_generator: ^8.3.0
angel3_framework: ^8.4.0
build_runner: ^2.4.0
lints: ^4.0.0
#dependency_overrides:
Expand Down

0 comments on commit 4ceaf7a

Please sign in to comment.