Skip to content

Commit 5de424b

Browse files
author
Isaque Neves
committed
decode timestamp without timezone as local DateTime and decode timestamp with timezone respecting the timezone defined in the connection, timeZone option in ConnectionSettings is now a TimeZoneSettings type instead of String
1 parent 0e2f966 commit 5de424b

File tree

4 files changed

+23
-16
lines changed

4 files changed

+23
-16
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,4 +90,8 @@ final manager = Manager();
9090

9191
## 3.2.1
9292

93-
- fix bug on format Schema
93+
- fix bug on format Schema
94+
95+
## 3.3.0
96+
97+
- **Breaking change**: decode timestamp without timezone as local DateTime and decode timestamp with timezone respecting the timezone defined in the connection

lib/src/pdo/postgres/dependencies/postgres_pool/postgres_pool.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ class PgPool implements PostgreSQLExecutionContext {
501501
isUnixSocket: _url.isUnixSocket,
502502
timeoutInSeconds: settings.connectTimeout.inSeconds,
503503
queryTimeoutInSeconds: settings.queryTimeout.inSeconds,
504-
timeZone: settings.timeZone,
504+
timeZone: TimeZoneSettings(settings.timeZone),
505505
encoding: settings.encoding,
506506
);
507507
await c.open();

lib/src/pdo/postgres_v3/postgres_v3_pdo.dart

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class PostgresV3PDO extends PDOInterface {
7373
[endpoint],
7474
settings: PoolSettings(
7575
applicationName: dsnParser.applicationName,
76-
timeZone: dsnParser.timezone,
76+
timeZone: TimeZoneSettings(dsnParser.timezone ?? 'UTC'),
7777
onOpen: (conn) async {
7878
await _onOpen(conn, dsnParser);
7979
},
@@ -82,13 +82,11 @@ class PostgresV3PDO extends PDOInterface {
8282
sslMode: sslMode,
8383
),
8484
);
85-
86-
8785
} else {
8886
connection = await Connection.open(endpoint,
8987
settings: ConnectionSettings(
9088
applicationName: dsnParser.applicationName,
91-
timeZone: dsnParser.timezone,
89+
timeZone: TimeZoneSettings(dsnParser.timezone ?? 'UTC'),
9290
onOpen: (conn) async {
9391
await _onOpen(conn, dsnParser);
9492
},

pubspec.yaml

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: eloquent
2-
version: 3.2.1
2+
version: 3.3.0
33
description: eloquent query builder port from PHP Laravel
44
homepage: https://github.com/insinfo/eloquent_dart
55
#publish_to: none
@@ -10,24 +10,29 @@ environment:
1010
dependencies:
1111
intl: '>=0.17.0 <3.0.0'
1212
#dargres: ^2.2.4
13-
dargres: ^3.0.2
14-
# dargres:
15-
# path: ../dargres
13+
dargres: ^3.1.0
14+
# dargres:
15+
# path: ../dargres
1616

1717
enough_convert: '>=1.6.0 <2.0.0'
1818

1919
#postgres:
2020
#path: ../postgresql-dart
2121
# postgres v2
22-
postgres_fork: ^2.7.0
23-
#postgres:
24-
#git:
25-
#ref: master
26-
#url: https://github.com/insinfo/postgresql-dart-1.git
22+
postgres_fork: ^2.8.0
23+
# postgres_fork:
24+
# path: ../postgresql-fork
25+
2726

2827
mysql_client: ^0.0.27
2928
# postgres v3
30-
postgres: ^3.1.2 #^3.0.5
29+
#postgres: ^3.1.2
30+
# postgres:
31+
# path: ../postgresql-v3
32+
postgres:
33+
git:
34+
ref: master
35+
url: https://github.com/insinfo/postgresql-dart.git
3136

3237

3338
dev_dependencies:

0 commit comments

Comments
 (0)