Re: JSON serialization in pgAdmin 4 - Mailing list pgadmin-hackers

From Ashesh Vashi
Subject Re: JSON serialization in pgAdmin 4
Date
Msg-id CAG7mmozkyyPWg8q_FvfrzyBHgBWR8dpf1tPPvmrdmoFuYBf5aQ@mail.gmail.com
Whole thread Raw
In response to JSON serialization in pgAdmin 4  (Lele Gaifax <lele@metapensiero.it>)
List pgadmin-hackers
Hi Emanuele,

On Sat, May 28, 2016 at 7:59 PM, Lele Gaifax <lele@metapensiero.it> wrote:
Hi all,

first of all, let me congratulate with you for how good pgAdmin 4 is quickly
becoming. I tried it now and then, and I'm always surprised by the amount of
effort you spend on it, thank you!
Thanks! 

I'd like to know if there is already a plan to properly handle date/timestamp
fields, that currently fail with an error because simplejson by default does
not know how the serialize (or deserialize) those data types.
Thanks for sharing the information.

Can you please share some more detailed information about it, where/in which condition it does fail?

One minimalistic approach would be subclassing the JSONEncoder and overriding
its default() method. This would solve the serialization problem, but I guess
that sooner or later we may want to support also the other way around.
Yeah - that's what we've done at one place. 

One further step in that direction could be using nssjson[1] (my fork of
simplejson that supports date/time/datetime/UUID out of the box). I
reimplemented the same functionality on top of python-rapidjson, but the
author didn't accept my PR[2] yet. Rapidjson is much faster on most
operations, but it's also very young...
We would certainly like to take a look at it.
Thanks for sharing the information.

--

Thanks & Regards,

Ashesh Vashi
EnterpriseDB INDIA: Enterprise PostgreSQL Company



Thanks in advance,
ciao, lele.

[1] https://pypi.python.org/pypi/nssjson
[2] https://github.com/kenrobbins/python-rapidjson/pull/35
--
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
lele@metapensiero.it  |                 -- Fortunato Depero, 1929.



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

pgadmin-hackers by date:

Previous
From: Lele Gaifax
Date:
Subject: JSON serialization in pgAdmin 4
Next
From: Lele Gaifax
Date:
Subject: Re: JSON serialization in pgAdmin 4