pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Álvaro Hernández Tortosa <aht@8Kdata.com>
To: Stephen Nelson <stephen@eccostudio.com>
To: Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
Cc: List <pgsql-jdbc@postgresql.org>
Subject: Re: SQLJSON
Date: Tue, 30 Jun 2015 09:22:13 +0200
Message-ID: <559243A5.4020708@8Kdata.com> (raw)
In-Reply-To: <CAHpHs3kMk7ykZg=KgB-j5_qHfg7JjDubJNhgJQFCs5eTzuL0tQ@mail.gmail.com>
References: <CADK3HH+RBjfo7gp3k-DSZYiZ-qS1BcS-OjG3xAgJhJDHbkgo_Q@mail.gmail.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>
	<CAHpHs3kMk7ykZg=KgB-j5_qHfg7JjDubJNhgJQFCs5eTzuL0tQ@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-jdbc>


On 30/06/15 09:07, Stephen Nelson wrote:
>
> +1
>
> With the caveat that this is the least worst option. Json is just text 
> so it can be easily parsed by your favourite json library.
>

     Stephen, the idea is to provide "built-in" support for Json out of 
the database, so that you don't need to parse it manually, which is a 
pain for many users. Plus, it opens the door for future optimizations is 
Json support is streamlined into the protocol.
>
> If I'm writing a web api which exposes json services I would be 
> annoyed if my jdbc driver has decided which json library I'll use for 
> my web api, or I'd have to use two different libraries and bloat my 
> jar/war.
>

     The current proposal does not force you, at all, to decide which 
JSON library to use. It returns a JsonValue, which is a JSR spec, and 
then you can do whatever you want. The RI is just 64Kb, so I wouldn't 
call it bloat.... and in exchange for that, you get a fully working 
driver with JSON support from the beginning.

     Regards,

     Álvaro


-- 
Álvaro Hernández Tortosa


-----------
8Kdata


>
> On Tue, 30 Jun 2015 00:01 Vladimir Sitnikov 
> <sitnikov.vladimir@gmail.com <mailto: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.
>
>     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
>     <mailto:pgsql-jdbc@postgresql.org>)
>     To make changes to your subscription:
>     http://www.postgresql.org/mailpref/pgsql-jdbc
>

view thread (103+ messages)  latest in thread

Message-ID: <559243A5.4020708@8Kdata.com>
Permalink:  ../559243A5.4020708@8Kdata.com/
Also on:    postgresql.org/message-id/559243A5.4020708@8Kdata.com

 · 

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 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, stephen@eccostudio.com, sitnikov.vladimir@gmail.com
  Subject: Re: SQLJSON
  In-Reply-To: <559243A5.4020708@8Kdata.com>
  References: <CADK3HH+RBjfo7gp3k-DSZYiZ-qS1BcS-OjG3xAgJhJDHbkgo_Q@mail.gmail.com> <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> <CAHpHs3kMk7ykZg=KgB-j5_qHfg7JjDubJNhgJQFCs5eTzuL0tQ@mail.gmail.com> <559243A5.4020708@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