Re: SQLJSON - Mailing list pgsql-jdbc

From Vitalii Tymchyshyn
Subject Re: SQLJSON
Date
Msg-id CABWW-d0WiQqRTMvEHyyuYDt2Cy2Bv7SPDTbyXk1SLRZAqTQv9g@mail.gmail.com
Whole thread Raw
In response to Re: SQLJSON  (Dave Cramer <pg@fastcrypt.com>)
Responses Re: SQLJSON  (Vladimir Sitnikov <sitnikov.vladimir@gmail.com>)
List pgsql-jdbc

As for me, the only problem is with getObject(i) call and I'd really prefer it to be backwards compatible (return String) unless some parameter is set.
As of getObject(i, JsonValue.class) I don't see any problem implementing it as a single jar. And if user calls you with this class, he obviously does have at least the API jar in his classpath. Its fairy easy to make an implementation that wont fail in both cases (no JsonValue in classpath - no support, has JsonValue - support is enabled when demanded with the respectitive getObject call).

Best regards, Vitalii Tymchyshyn

Пн, 29 черв. 2015 19:34 Dave Cramer <pg@fastcrypt.com> пише:
On 29 June 2015 at 19:00, Vladimir Sitnikov <sitnikov.vladimir@gmail.com> wrote:
Álvaro, Dave,

If I understand you right, you "just" want to make "usage of json
feature" easy for end-users.
So do I.
If there is more, please add.

What if we do the following?
1) We keep "base" part of driver "unaware" of json. In other words,
calls like getObject(1, JsonValue.class) would end up in "@throws
SQLException if conversion is not supported" (as per ResultSet's
javadoc)
2) Add "pgjdbc-json" module (i.e. jar) that adds support for
getObject(1, JsonValue.class), setObject(1, JsonValue) kind of calls.
3) Document "best choice of json dependencies" right in the readme. I
think we would be fine even with simple "we tested just jackson and it
works with pgjdbc".

From the end-user perspective it will be:
1) Using driver as usual -- "just add one mvn dependency" --
'org.postgresql:postgresql:9.4-1201-jdbc41'
2) Adding json support -- add additional one --
'org.postgresql:postgresql-json:9.4-1201-jdbc41' and
'best-of-the-best-pgjdbc-approved-json-impl:3.14.15'.

Both items would be available on the top of readme as copy&paste ready snippets.

adding support with maven is the least problematic solution; Not everyone uses maven unfortunately.
It would appear we will need more than one jar  

This covers "json support" and it is user-friendly: no additional
googling is required to use the feature.
Am I missing anything?

Vladimir


--
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc

pgsql-jdbc by date:

Previous
From: Álvaro Hernández Tortosa
Date:
Subject: Re: SQLJSON
Next
From: Christopher BROWN
Date:
Subject: Re: SQLJSON