Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Z9pt4-0007ff-3O for pgsql-jdbc@arkaria.postgresql.org; Tue, 30 Jun 2015 07:23:22 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1Z9pt3-0005Ym-3l for pgsql-jdbc@arkaria.postgresql.org; Tue, 30 Jun 2015 07:23:21 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1Z9ps4-0004aY-Uo for pgsql-jdbc@postgresql.org; Tue, 30 Jun 2015 07:22:21 +0000 Received: from mail-wi0-f171.google.com ([209.85.212.171]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1Z9ps1-0001Xd-Oz for pgsql-jdbc@postgresql.org; Tue, 30 Jun 2015 07:22:19 +0000 Received: by widjy10 with SMTP id jy10so22002947wid.1 for ; Tue, 30 Jun 2015 00:22:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type; bh=A0oOxtaDDzG1bifbkuMjoX1bgNR1I8UglNh95uASVIs=; b=gOKywD16XgHbT80FSfFcgVMlgisD7gBp6YZ+0DPj6jvs1PzUBaimAiq9Z7IadRZUKY 6m0jcCF1FhEzWyuAR4TAFV9y80zoYyNmpDRD+nbf1In5GxwZc7QXlTwJE5wfwkQnqnNg Vlj1uoQ7ez2SzrxXhn2P57yljT4vHfHNUZ1wZRXk86OoARO/awrh2H5vAtkrNmsjDtb7 UgbrwL9rTQszVAiONE/1L4JReJeJv50v+8ZCv+AOJEulbO6btW8NB1yt62fUC4gZHrR0 1ipq5jeh9xOELihqF2P9EeVhCSlYO6cz0vcbfzy7F0Kk1GbDs0UC6I6FklJ73F6OKiT4 DDsA== X-Gm-Message-State: ALoCoQkN2FZPk5vLjwf9W+BCYRyHmPkVFuzE96Qt1y3TnVyVARhtX6shjK/O2UTOmF+V7v2b/KLS X-Received: by 10.180.99.132 with SMTP id eq4mr165371wib.88.1435648936292; Tue, 30 Jun 2015 00:22:16 -0700 (PDT) Received: from [192.168.43.95] ([31.4.238.20]) by mx.google.com with ESMTPSA id js3sm67361118wjc.5.2015.06.30.00.22.14 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 30 Jun 2015 00:22:15 -0700 (PDT) Message-ID: <559243A5.4020708@8Kdata.com> Date: Tue, 30 Jun 2015 09:22:13 +0200 From: =?UTF-8?B?w4FsdmFybyBIZXJuw6FuZGV6IFRvcnRvc2E=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Stephen Nelson , Vladimir Sitnikov CC: List Subject: Re: SQLJSON References: <002701d0b104$114cdd60$33e69820$@eu> <000601d0b125$17d3fee0$477bfca0$@eu> <558F22BE.5050508@8Kdata.com> <558F377B.7040606@8Kdata.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> In-Reply-To: Content-Type: multipart/alternative; boundary="------------090604080606000409030002" X-Pg-Spam-Score: -0.3 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org This is a multi-part message in MIME format. --------------090604080606000409030002 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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 > > 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 > ) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-jdbc > --------------090604080606000409030002 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
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> 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)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc

--------------090604080606000409030002--