Skip to content

Commit

Permalink
decode timestamp without timezone as local DateTime and decode timest…
Browse files Browse the repository at this point in the history
…amp with timezone respecting the timezone defined in the connection, timeZone option in ConnectionSettings is now a TimeZoneSettings type instead of String
  • Loading branch information
Isaque Neves committed Jul 19, 2024
1 parent 0e2f966 commit 5de424b
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 16 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,8 @@ final manager = Manager();

## 3.2.1

- fix bug on format Schema
- fix bug on format Schema

## 3.3.0

- **Breaking change**: decode timestamp without timezone as local DateTime and decode timestamp with timezone respecting the timezone defined in the connection
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ class PgPool implements PostgreSQLExecutionContext {
isUnixSocket: _url.isUnixSocket,
timeoutInSeconds: settings.connectTimeout.inSeconds,
queryTimeoutInSeconds: settings.queryTimeout.inSeconds,
timeZone: settings.timeZone,
timeZone: TimeZoneSettings(settings.timeZone),
encoding: settings.encoding,
);
await c.open();
Expand Down
6 changes: 2 additions & 4 deletions lib/src/pdo/postgres_v3/postgres_v3_pdo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class PostgresV3PDO extends PDOInterface {
[endpoint],
settings: PoolSettings(
applicationName: dsnParser.applicationName,
timeZone: dsnParser.timezone,
timeZone: TimeZoneSettings(dsnParser.timezone ?? 'UTC'),
onOpen: (conn) async {
await _onOpen(conn, dsnParser);
},
Expand All @@ -82,13 +82,11 @@ class PostgresV3PDO extends PDOInterface {
sslMode: sslMode,
),
);


} else {
connection = await Connection.open(endpoint,
settings: ConnectionSettings(
applicationName: dsnParser.applicationName,
timeZone: dsnParser.timezone,
timeZone: TimeZoneSettings(dsnParser.timezone ?? 'UTC'),
onOpen: (conn) async {
await _onOpen(conn, dsnParser);
},
Expand Down
25 changes: 15 additions & 10 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: eloquent
version: 3.2.1
version: 3.3.0
description: eloquent query builder port from PHP Laravel
homepage: https://github.com/insinfo/eloquent_dart
#publish_to: none
Expand All @@ -10,24 +10,29 @@ environment:
dependencies:
intl: '>=0.17.0 <3.0.0'
#dargres: ^2.2.4
dargres: ^3.0.2
# dargres:
# path: ../dargres
dargres: ^3.1.0
# dargres:
# path: ../dargres

enough_convert: '>=1.6.0 <2.0.0'

#postgres:
#path: ../postgresql-dart
# postgres v2
postgres_fork: ^2.7.0
#postgres:
#git:
#ref: master
#url: https://github.com/insinfo/postgresql-dart-1.git
postgres_fork: ^2.8.0
# postgres_fork:
# path: ../postgresql-fork


mysql_client: ^0.0.27
# postgres v3
postgres: ^3.1.2 #^3.0.5
#postgres: ^3.1.2
# postgres:
# path: ../postgresql-v3
postgres:
git:
ref: master
url: https://github.com/insinfo/postgresql-dart.git


dev_dependencies:
Expand Down

0 comments on commit 5de424b

Please sign in to comment.