JSON serialization in pgAdmin 4

From: Lele Gaifax <lele(at)metapensiero(dot)it>
To: pgadmin-hackers(at)postgresql(dot)org
Subject: JSON serialization in pgAdmin 4
Date: 2016-05-28 14:29:33
Message-ID: 87mvnauugi.fsf@metapensiero.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

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!

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.

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.

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...

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.

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Ashesh Vashi 2016-05-28 15:29:26 Re: JSON serialization in pgAdmin 4
Previous Message Ashesh Vashi 2016-05-28 14:17:30 Re: PATCH: To fix issue in removing comments in edit mode (pgAdmin4)