Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Z8XRO-0005VU-3L for pgsql-jdbc@arkaria.postgresql.org; Fri, 26 Jun 2015 17:29:26 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1Z8XRN-0002kq-J0 for pgsql-jdbc@arkaria.postgresql.org; Fri, 26 Jun 2015 17:29:25 +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 1Z8XRM-0002kd-AS for pgsql-jdbc@postgresql.org; Fri, 26 Jun 2015 17:29:24 +0000 Received: from mail-pd0-x231.google.com ([2607:f8b0:400e:c02::231]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1Z8XRJ-0002zF-AG for pgsql-jdbc@postgresql.org; Fri, 26 Jun 2015 17:29:22 +0000 Received: by pdbep18 with SMTP id ep18so56851151pdb.1 for ; Fri, 26 Jun 2015 10:29:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=sSkWq4N99pQNLaoMDqJ4uSlNNLbne0Fv+omJ7odigp0=; b=YPMyjKJfr8yejFxKIJU8Ojr5juJvBYzlitaeLVF4kyucVdd4pl0APSzReZE6vnZvt9 xoXGayzetYb5Wa7RNdGPj+jBurgui3OGpcBmRzbjudSGqldTRIiX7Zm8TBCWTVDth4D6 uc+GPKfOb/xj4PFdxzig5ae3UPq4KdTrodq5ZEFuakzX0NyrUjH/KHPCdRi8ak+kDWBk 4bnPcBAiSHPRKbzBM/5f1gpqeu+EO6BoGioVPw3hjJRvJE8FHp6gb+oN4GMb41ZbPTSl 2VNK2kj6PoS9UPpanv4l3IEpli/6RTSQFL/ojUYxv8EILCJbi2EL8/0sYvw+J1qDW236 fbcg== X-Received: by 10.70.52.1 with SMTP id p1mr5326266pdo.113.1435339760182; Fri, 26 Jun 2015 10:29:20 -0700 (PDT) Received: from [10.10.21.68] (otra.opentable.com. [199.16.144.7]) by mx.google.com with ESMTPSA id q4sm34012978pdo.42.2015.06.26.10.29.19 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 26 Jun 2015 10:29:19 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: SQLJSON From: Steven Schlansker In-Reply-To: Date: Fri, 26 Jun 2015 10:29:17 -0700 Cc: List Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Dave Cramer X-Mailer: Apple Mail (2.1878.6) X-Pg-Spam-Score: -1.2 (-) 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 On Jun 26, 2015, at 10:23 AM, Dave Cramer wrote: >=20 > On 26 June 2015 at 13:01, Steven Schlansker = wrote: >=20 > On Jun 26, 2015, at 7:57 AM, Dave Cramer wrote: >=20 > > I'm looking for comments on how to implement a SQLJSON type in JDBC. > > > > As there is no getSQLJSON in the resultset interface this could only be= used in getObject. > > > > Notionally it would model itself after SQLXML. https://docs.oracle.com/= javase/7/docs/api/index.html?java/sql/SQLXML.html >=20 > I used JSON extensively in one of my projects, but have never used SQLXML= . I'm having trouble understanding why the SQLXML interface adds any value= to passing rs.getBinaryStream to your favorite JSON parser. Especially si= nce you would have to use getObject, I am not seeing how: >=20 > rs.getObject("field", SQLJSON.class).mapToType(MyType.class) >=20 > is simpler than: > jacksonObjectMapper.readValue(rs.getBinaryStream("field"), MyType.class) >=20 > which already works today as far as I understand. Doubly so since nobody= will agree on which JSON parsing library to use. >=20 > I'm sure I'm missing something? >=20 >=20 > I don't think you are; as you rightly pointed out now we would have to ad= d a json parser to the driver, which I'm reluctant to do=20 >=20 If this feature is developed, I think the JSON parser should be pluggable a= nd optional if possible. Then users that do not want it do not need to dra= g in a large dependency. That said, without a more convincing use case or a compelling API that we c= ould easily add, I don't see this interface being "worth its weight" as an = addition. --=20 Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc