Skip to content

Commit 1c630e2

Browse files
committed
update allowReuse nullability
1 parent 1d74c21 commit 1c630e2

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 2.4.1+1
4+
5+
- Fix error when passing `allowReuse: null` into `query()` [#8](https://github.com/isoos/postgresql-dart/pull/8)
6+
37
## 2.4.1
48

59
- Support for type `interval`, [#10](https://github.com/isoos/postgresql-dart/pull/10).

lib/src/connection.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -416,13 +416,13 @@ abstract class _PostgreSQLExecutionContextMixin
416416
Future<PostgreSQLResult> query(
417417
String fmtString, {
418418
Map<String, dynamic>? substitutionValues,
419-
bool? allowReuse = true,
419+
bool? allowReuse,
420420
int? timeoutInSeconds,
421421
}) =>
422422
_query(
423423
fmtString,
424424
substitutionValues: substitutionValues,
425-
allowReuse: allowReuse!,
425+
allowReuse: allowReuse ?? true,
426426
timeoutInSeconds: timeoutInSeconds,
427427
);
428428

@@ -467,12 +467,12 @@ abstract class _PostgreSQLExecutionContextMixin
467467
Future<List<Map<String, Map<String, dynamic>>>> mappedResultsQuery(
468468
String fmtString,
469469
{Map<String, dynamic>? substitutionValues = const {},
470-
bool? allowReuse = false,
470+
bool? allowReuse,
471471
int? timeoutInSeconds}) async {
472472
final rs = await query(
473473
fmtString,
474474
substitutionValues: substitutionValues,
475-
allowReuse: allowReuse!,
475+
allowReuse: allowReuse ?? false,
476476
timeoutInSeconds: timeoutInSeconds,
477477
);
478478

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.
3-
version: 2.4.1
3+
version: 2.4.1+1
44
homepage: https://github.com/isoos/postgresql-dart
55

66
environment:

0 commit comments

Comments
 (0)