Re: JSON serialization in pgAdmin 4

From: Ashesh Vashi <ashesh(dot)vashi(at)enterprisedb(dot)com>
To: Lele Gaifax <lele(at)metapensiero(dot)it>
Cc: pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Re: JSON serialization in pgAdmin 4
Date: 2016-05-28 15:29:26
Message-ID: CAG7mmozkyyPWg8q_FvfrzyBHgBWR8dpf1tPPvmrdmoFuYBf5aQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Hi Emanuele,

On Sat, May 28, 2016 at 7:59 PM, Lele Gaifax <lele(at)metapensiero(dot)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
<http://www.enterprisedb.com/>

*http://www.linkedin.com/in/asheshvashi*
<http://www.linkedin.com/in/asheshvashi>

>
> 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(at)metapensiero(dot)it | -- Fortunato Depero, 1929.
>
>
>
> --
> Sent via pgadmin-hackers mailing list (pgadmin-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgadmin-hackers
>

In response to

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Lele Gaifax 2016-05-28 17:38:53 Re: JSON serialization in pgAdmin 4
Previous Message Lele Gaifax 2016-05-28 14:29:33 JSON serialization in pgAdmin 4