pgjdbc/pgjdbc GitHub issues and pull requests (mirror)
help / color / mirror / Atom feedFrom: geekbeast (@geekbeast) <[email protected]>
To: pgjdbc/pgjdbc <[email protected]>
Subject: Re: [pgjdbc/pgjdbc] issue #1225: Java 8 Time Support for Postgres Arrays
Date: Fri, 27 Jul 2018 11:10:45 +0000
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
Mostly for read as I get an array due to an ```array_agg(...)``` on the read.
I worked around it for now with:
```
case Date:
objects = Stream
.of( (Date[]) arr.getArray() )
.map( Date::toLocalDate )
.collect( Collectors.toList() );
break;
case TimeOfDay:
objects = Stream
.of( (Time[]) arr.getArray() )
.map( Time::toLocalTime )
.collect( Collectors.toList() );
break;
case DateTimeOffset:
objects = Stream
.of( (Timestamp[]) arr.getArray() )
.map( ts -> OffsetDateTime
.ofInstant( Instant.ofEpochMilli( ts.getTime() ), ZoneId.of( "UTC" ) ) )
.collect( Collectors.toList() );
```
view thread (16+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: github://pgjdbc/pgjdbc
Cc: [email protected], [email protected]
Subject: Re: [pgjdbc/pgjdbc] issue #1225: Java 8 Time Support for Postgres Arrays
In-Reply-To: <<[email protected]>>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox