Skip to content

Commit 71e7ef8

Browse files
committed
Default to scalar values for LOB column retrieval according to spec changes
[resolves #190]
1 parent 3e33397 commit 71e7ef8

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ This reference table shows the type mapping between [PostgreSQL][p] and Java dat
275275
| [`smallint`][psql-smallint-ref] | [**`Short`**][java-short-ref], [`Boolean`][java-boolean-ref], [`Byte`][java-byte-ref], [`Integer`][java-integer-ref], [`Long`][java-long-ref], [`BigDecimal`][java-bigdecimal-ref]|
276276
| [`smallserial`][psql-smallserial-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]|
277277
| [`serial`][psql-serial-ref] | [**`Long`**][java-long-ref], [`Boolean`][java-boolean-ref], [`Byte`][java-byte-ref], [`Short`][java-short-ref], [`Integer`][java-integer-ref], [`BigDecimal`][java-bigdecimal-ref]|
278-
| [`text`][psql-text-ref] | [`String`][java-string-ref]|
278+
| [`text`][psql-text-ref] | [**`String`**][java-string-ref], `Clob`|
279279
| [`time [without time zone]`][psql-time-ref] | [`LocalTime`][java-lt-ref]|
280280
| [`time [with time zone]`][psql-time-ref] | Not yet supported.|
281281
| [`timestamp [without time zone]`][psql-time-ref]|[**`LocalDateTime`**][java-ldt-ref], [`LocalTime`][java-lt-ref], [`LocalDate`][java-ld-ref]|

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,8 @@ public DefaultCodecs(ByteBufAllocator byteBufAllocator) {
5454
new BinaryByteArrayCodec(byteBufAllocator),
5555

5656
new BigDecimalCodec(byteBufAllocator),
57-
new BlobCodec(byteBufAllocator),
5857
new BooleanCodec(byteBufAllocator),
5958
new CharacterCodec(byteBufAllocator),
60-
new ClobCodec(byteBufAllocator),
6159
new DoubleCodec(byteBufAllocator),
6260
new FloatCodec(byteBufAllocator),
6361
new InetAddressCodec(byteBufAllocator),
@@ -85,6 +83,9 @@ public DefaultCodecs(ByteBufAllocator byteBufAllocator) {
8583
new ByteCodec(byteBufAllocator),
8684
new DateCodec(byteBufAllocator),
8785

86+
new BlobCodec(byteBufAllocator),
87+
new ClobCodec(byteBufAllocator),
88+
8889
new ShortArrayCodec(byteBufAllocator),
8990
new StringArrayCodec(byteBufAllocator),
9091
new IntegerArrayCodec(byteBufAllocator),

src/test/java/io/r2dbc/postgresql/ExtendedQueryPostgresqlStatementTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ void bind() {
7777

7878
@Test
7979
void bindIndex() {
80-
assertThat(((ExtendedQueryPostgresqlStatement) this.statement.bind(0, 100)).getCurrentBinding()).isEqualTo(new Binding(1).add(0, this.parameter));
80+
assertThat(this.statement.bind(0, 100).getCurrentBinding()).isEqualTo(new Binding(1).add(0, this.parameter));
8181
}
8282

8383
@Test

0 commit comments

Comments
 (0)