mirror of https://github.com/AMT-Cheif/drift.git
Add timestamp with timezone type
This commit is contained in:
parent
f84407a8cb
commit
c4169f6f91
|
@ -1,3 +1,7 @@
|
|||
## 1.1.0
|
||||
|
||||
- Add `PgTypes.timestampWithTimezone`.
|
||||
|
||||
## 1.0.0
|
||||
|
||||
- __Breaking__: The interval type now expects `Interval` types from postgres
|
||||
|
|
|
@ -49,6 +49,13 @@ final class PgTypes {
|
|||
PgDate.fromDateTime,
|
||||
);
|
||||
|
||||
/// The `timestamp with time zone` type in Postgres.
|
||||
static const CustomSqlType<PgDateTime> timestampWithTimezone = DateType(
|
||||
pg.Type.timestampWithTimezone,
|
||||
'timestamp with time zone',
|
||||
PgDateTime.new,
|
||||
);
|
||||
|
||||
/// The `timestamp without time zone` type in Postgres.
|
||||
static const CustomSqlType<PgDateTime> timestampNoTimezone = DateType(
|
||||
pg.Type.timestampWithoutTimezone,
|
||||
|
|
|
@ -47,6 +47,12 @@ void main() {
|
|||
group('json', () => testWith(PgTypes.json, {'foo': 'bar'}));
|
||||
group('jsonb', () => testWith(PgTypes.jsonb, {'foo': 'bar'}));
|
||||
group('point', () => testWith(PgTypes.point, pg.Point(90, -90)));
|
||||
group(
|
||||
'timestamp with timezone',
|
||||
() => testWith(PgTypes.timestampWithTimezone,
|
||||
PgDateTime(DateTime.utc(1996, 7, 8, 10, 0, 0))),
|
||||
);
|
||||
|
||||
group(
|
||||
'timestamp without timezone',
|
||||
() => testWith(PgTypes.timestampNoTimezone,
|
||||
|
|
Loading…
Reference in New Issue