From: Álvaro Hernández Tortosa <aht@8Kdata.com>
To: Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
Cc: List <pgsql-jdbc@postgresql.org>
Subject: Re: SQLJSON
Date: Tue, 30 Jun 2015 01:40:32 +0200
Message-ID: <5591D770.3050904@8Kdata.com> (raw)
In-Reply-To: <CAB=Je-H-tgJ-hGUqWk83A4M7mheBELGUXKj2qe4ECbVPeyaebA@mail.gmail.com>
References: <CADK3HH+RBjfo7gp3k-DSZYiZ-qS1BcS-OjG3xAgJhJDHbkgo_Q@mail.gmail.com>
<558ED5A6.4070500@8Kdata.com>
<002701d0b104$114cdd60$33e69820$@eu>
<CADK3HHJLxgo9BfyhZWn0qcRcEXhe01g9NppOymBScV5wqB=7Pw@mail.gmail.com>
<000601d0b125$17d3fee0$477bfca0$@eu>
<CAH7T-arHGk_tyJZkJjubBVmip_FY5NR7xkquVTGwN5FLWxkqnA@mail.gmail.com>
<558F22BE.5050508@8Kdata.com>
<CAH7T-aoBTDQncoodf6N4LfdKE7si7oRrNp1FeRjz2wL5UHrV8g@mail.gmail.com>
<558F377B.7040606@8Kdata.com>
<CAHL_zcNbBhYh186q6sMdoG59BB8zhW3TG2s_Prnts3yuJzNQRA@mail.gmail.com>
<558FC12E.8010107@8Kdata.com>
<000301d0b187$aeb51a30$0c1f4e90$@eu>
<558FC4E1.7020005@8Kdata.com>
<001301d0b1b4$7f0862b0$7d192810$@eu>
<5590458C.3040805@8Kdata.com>
<002901d0b288$52a8e080$f7faa180$@eu>
<5591960B.7070406@8Kdata.com>
<007c01d0b2a3$9614bfe0$c23e3fa0$@eu>
<5591ADFD.8000304@8Kdata.com>
<000301d0b2b4$042a41c0$0c7ec540$@eu>
<5591C898.8090102@8Kdata.com>
<CAB=Je-H-tgJ-hGUqWk83A4M7mheBELGUXKj2qe4ECbVPeyaebA@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-jdbc>
Hi Vladimir.
On 30/06/15 01:00, Vladimir Sitnikov 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.
IMHO, it's nothing more than that :)
>
> 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)
I am not against having a json-unaware version of the driver, but I
wouldn't make it the default. To me, a RuntimeException over an expected
behavior is not user-friendly. So this version would be either for users
that don't want JSON at all, or for very advanced users that want to
supply other potentially conflicting versions of JSR353.
> 2) Add "pgjdbc-json" module (i.e. jar) that adds support for
> getObject(1, JsonValue.class), setObject(1, JsonValue) kind of calls.
I would make this the default, aka "the driver".
> 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.
>
> This covers "json support" and it is user-friendly: no additional
> googling is required to use the feature.
> Am I missing anything?
>
> Vladimir
As I mentioned, my opinion is that the default is the one that
works without throwing an exception. You plug it in, and it works. This
is what I believe users would expect.
As there's debate, I think we should approach it from an analysis
perspective: let's build a list of pros and cons and then compare.
Because all the arguments against bundling the API are basically avoid
potential conflicts, but in my opinion that is extremely unlikely and
hence not practical to address. Any future JSR353 spec would probably
require many changes anyway (if JSR353 ever changes, it would probably
be to be integrated in Java10). And bundling the RI is just adding 64Kb,
and wrapping the code in different classes as Dave suggested, to avoid
any conflicts.
So the JDBC+API+wrapped RI is a bundle that just works, weights
just 96Kb more than the JDBC current driver and would only cause
conflicts if JSR353 is ever updated. But it provides a hassle free, no
googling required, works out-of-the-box JSON experience. Then we could
also package as non-default, specialized versions, one without the RI
and one without API and without the RI.
If there are further inconveniences in making the API+RI bundle the
default, please specify.
Thanks,
Álvaro
--
Álvaro Hernández Tortosa
-----------
8Kdata
--
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: aht@8Kdata.com, sitnikov.vladimir@gmail.com
Subject: Re: SQLJSON
In-Reply-To: <5591D770.3050904@8Kdata.com>
References: <CADK3HH+RBjfo7gp3k-DSZYiZ-qS1BcS-OjG3xAgJhJDHbkgo_Q@mail.gmail.com> <558ED5A6.4070500@8Kdata.com> <002701d0b104$114cdd60$33e69820$@eu> <CADK3HHJLxgo9BfyhZWn0qcRcEXhe01g9NppOymBScV5wqB=7Pw@mail.gmail.com> <000601d0b125$17d3fee0$477bfca0$@eu> <CAH7T-arHGk_tyJZkJjubBVmip_FY5NR7xkquVTGwN5FLWxkqnA@mail.gmail.com> <558F22BE.5050508@8Kdata.com> <CAH7T-aoBTDQncoodf6N4LfdKE7si7oRrNp1FeRjz2wL5UHrV8g@mail.gmail.com> <558F377B.7040606@8Kdata.com> <CAHL_zcNbBhYh186q6sMdoG59BB8zhW3TG2s_Prnts3yuJzNQRA@mail.gmail.com> <558FC12E.8010107@8Kdata.com> <000301d0b187$aeb51a30$0c1f4e90$@eu> <558FC4E1.7020005@8Kdata.com> <001301d0b1b4$7f0862b0$7d192810$@eu> <5590458C.3040805@8Kdata.com> <002901d0b288$52a8e080$f7faa180$@eu> <5591960B.7070406@8Kdata.com> <007c01d0b2a3$9614bfe0$c23e3fa0$@eu> <5591ADFD.8000304@8Kdata.com> <000301d0b2b4$042a41c0$0c7ec540$@eu> <5591C898.8090102@8Kdata.com> <CAB=Je-H-tgJ-hGUqWk83A4M7mheBELGUXKj2qe4ECbVPeyaebA@mail.gmail.com> <5591D770.3050904@8Kdata.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox