Skip to content

Commit 5a7675c

Browse files
committed
expose connection settings.
1 parent d34a03b commit 5a7675c

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## 2.0.0-rc.1
1+
## 2.0.0-rc.2
22

33
- Migrate to `postgres` v3.
44

lib/src/database_access.dart

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -232,12 +232,14 @@ abstract class DatabaseAccessBase<TX extends DatabaseTransactionBase<TABLES>,
232232
TABLES extends TablesBase> {
233233
DatabaseAccessBase({
234234
required this.config,
235+
this.connectionSettings,
235236
required this.tables,
236237
required this.migrations,
237238
});
238239

239240
final TABLES tables;
240241
final DatabaseConfig config;
242+
final ConnectionSettings? connectionSettings;
241243
final MigrationsProvider<TX, TABLES> migrations;
242244

243245
Connection? _conn;
@@ -246,13 +248,15 @@ abstract class DatabaseAccessBase<TX extends DatabaseTransactionBase<TABLES>,
246248
if (_conn != null) {
247249
return _conn!;
248250
}
249-
final conn = await Connection.open(Endpoint(
250-
host: config.host,
251-
port: config.port,
252-
database: config.databaseName,
253-
username: config.username,
254-
password: config.password,
255-
));
251+
final conn = await Connection.open(
252+
Endpoint(
253+
host: config.host,
254+
port: config.port,
255+
database: config.databaseName,
256+
username: config.username,
257+
password: config.password,
258+
),
259+
settings: connectionSettings);
256260
return _conn = conn;
257261
}
258262

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: postgres_utils
22
description: A few utils for working with postgresql databases.
3-
version: 2.0.0-rc.1
3+
version: 2.0.0-rc.2
44
homepage: https://github.com/authpass/postgres_utils.dart
55
issue_tracker: https://github.com/authpass/postgres_utils.dart/issues
66

0 commit comments

Comments
 (0)