Skip to content

Commit 9fa3078

Browse files
Francisco Guerreromp911de
authored andcommitted
Add IntervalCodec and Interval class
Support the Postgres Interval type by adding the IntervalCodec. [resolves #345][#353]
1 parent b8da414 commit 9fa3078

File tree

7 files changed

+1325
-1
lines changed

7 files changed

+1325
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ This reference table shows the type mapping between [PostgreSQL][p] and Java dat
330330
| [`hstore`][psql-hstore-ref] | [**`Map`**][java-map-ref]|
331331
| [`inet`][psql-inet-ref] | [**`InetAddress`**][java-inet-ref]|
332332
| [`integer`][psql-integer-ref] | [**`Integer`**][java-integer-ref], [`Boolean`][java-boolean-ref], [`Byte`][java-byte-ref], [`Short`][java-short-ref], [`Long`][java-long-ref], [`BigDecimal`][java-bigdecimal-ref], [`BigInteger`][java-biginteger-ref]|
333-
| [`interval`][psql-interval-ref] | Not yet supported.|
333+
| [`interval`][psql-interval-ref] | **`Interval`**|
334334
| [`json`][psql-json-ref] | **`Json`**, [`String`][java-string-ref]. Reading: `ByteBuf`[`byte[]`][java-primitive-ref], [`ByteBuffer`][java-ByteBuffer-ref], [`String`][java-string-ref], [`InputStream`][java-inputstream-ref]|
335335
| [`jsonb`][psql-json-ref] | **`Json`**, [`String`][java-string-ref]. Reading: `ByteBuf`[`byte[]`][java-primitive-ref], [`ByteBuffer`][java-ByteBuffer-ref], [`String`][java-string-ref], [`InputStream`][java-inputstream-ref]|
336336
| [`line`][psql-line-ref] | **`Line`**|

src/main/java/io/r2dbc/postgresql/codec/DefaultCodecs.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ public DefaultCodecs(ByteBufAllocator byteBufAllocator, boolean preferAttachedBu
7373
new FloatCodec(byteBufAllocator),
7474
new InetAddressCodec(byteBufAllocator),
7575
new IntegerCodec(byteBufAllocator),
76+
new IntervalCodec(byteBufAllocator),
7677
new LocalDateCodec(byteBufAllocator),
7778
new LocalDateTimeCodec(byteBufAllocator),
7879
new LocalTimeCodec(byteBufAllocator),

0 commit comments

Comments
 (0)