Re: PDO native JSON / array support

From: Date: Wed, 26 Jul 2017 12:42:05 +0000
Subject: Re: PDO native JSON / array support
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-100043@lists.php.net to get a copy of this message
On 26 July 2017 11:25:00 BST, "Michał" <aaatoja@o2.pl> wrote: >Most database systems have now native support for JSON format. Some of >them, like PostgreSQL, also accepts arrays. I rememeber there was some >fork of pgsql extension with native array support. > >Maybe it is time to extend PDO so it can accept at least one of these >formats? What do You think? Hi, What would "support" exactly mean for a JSON type? Since JSON is a way of serialising data into a string, wouldn't all JSON values going into and out of the database just look like strings to the driver? For Postgres's array types, some support for serialising and unserialising would definitely be useful, though, because the format is rather complex, particularly if you have multidimensional and sparse arrays. Obviously, users now have the workaround of transferring as JSON, but I know my last company had a pair of utility functions to attempt this in userland, which were known to be buggy in certain edge cases. Regards, -- Rowan Collins [IMSoP]

« previous php.internals (#100043) next »