Skip to content

Commit 1cf35f1

Browse files
committed
Small fixes
1 parent 2ade553 commit 1cf35f1

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

lib/src/pool/pool_impl.dart

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,6 @@ class PoolImplementation<L> implements Pool<L> {
198198
// flag is set, otherwise race conditions may create conflicts or
199199
// pool close may miss the connection.
200200
_connections.add(newc);
201-
print(_connections.length);
202201
return newc;
203202
}
204203
}
@@ -230,13 +229,13 @@ class _PoolConnection implements Connection {
230229

231230
bool _isExpired() {
232231
final age = DateTime.now().difference(_opened);
233-
if (age > _pool._settings.maxConnectionAge) {
232+
if (age >= _pool._settings.maxConnectionAge) {
234233
return true;
235234
}
236-
if (_elapsedInUse > _pool._settings.maxSessionUse) {
235+
if (_elapsedInUse >= _pool._settings.maxSessionUse) {
237236
return true;
238237
}
239-
if (_queryCount > _pool._settings.maxQueryCount) {
238+
if (_queryCount >= _pool._settings.maxQueryCount) {
240239
return true;
241240
}
242241
return false;

lib/src/v3/connection.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,12 +290,12 @@ class PgConnectionImplementation extends _PgSessionBase implements Connection {
290290
// transaction and should be reporte to the user.
291291
_TransactionSession? _activeTransaction;
292292

293-
final Map<String, String> _parameters = {};
293+
final _parameters = <String, String>{};
294294

295295
var _statementCounter = 0;
296296
var _portalCounter = 0;
297297

298-
late final _Channels _channels = _Channels(this);
298+
late final _channels = _Channels(this);
299299

300300
@override
301301
Channels get channels => _channels;
@@ -364,7 +364,7 @@ class PgConnectionImplementation extends _PgSessionBase implements Connection {
364364
// Unlike runTx, this doesn't need any locks. An active transaction changes
365365
// the state of the connection, this method does not. If methods requiring
366366
// locks are called by [fn], these methods will aquire locks as needed.
367-
return Future.sync(() => fn(session));
367+
return Future<R>(() => fn(session));
368368
}
369369

370370
@override

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: postgres
22
description: PostgreSQL database driver. Supports statement reuse and binary protocol and connection pooling.
3-
version: 3.0.0-beta.1
3+
version: 3.0.0-rc.1
44
homepage: https://github.com/isoos/postgresql-dart
55
topics:
66
- sql

0 commit comments

Comments
 (0)