Re: [GENERAL] Best way to populate nested composite type from JSON`

2013-09-16 Thread Merlin Moncure
On Fri, Sep 13, 2013 at 7:52 PM, Chris Travers wrote: > On Fri, Sep 13, 2013 at 8:51 AM, Merlin Moncure wrote: >> What's your client side stack? >> >> merlin > > > Right now we are using something a little lighter weight in terms db > discovery but it doesn't handle this situation very well. I a

Re: [GENERAL] Best way to populate nested composite type from JSON`

2013-09-13 Thread Chris Travers
On Fri, Sep 13, 2013 at 8:51 AM, Merlin Moncure wrote: > > > What's your client side stack? > > merlin > Right now we are using something a little lighter weight in terms db discovery but it doesn't handle this situation very well. I am the author of the PGObject space on CPAN and currently we

Re: [GENERAL] Best way to populate nested composite type from JSON`

2013-09-13 Thread Merlin Moncure
On Fri, Sep 13, 2013 at 10:08 AM, Chris Travers wrote: > On Fri, Sep 13, 2013 at 7:58 AM, Merlin Moncure wrote: >> Yup. As things stand currently, it's better *not* to make >> serialization-driving composite types which when learning the json >> stuff I did heavily; it was a habit I learned (and

Re: [GENERAL] Best way to populate nested composite type from JSON`

2013-09-13 Thread Chris Travers
On Fri, Sep 13, 2013 at 7:58 AM, Merlin Moncure wrote: > Yup. As things stand currently, it's better *not* to make > serialization-driving composite types which when learning the json > stuff I did heavily; it was a habit I learned (and had to unlearn) > from libpqtypes which solves a lot of t

Re: [GENERAL] Best way to populate nested composite type from JSON`

2013-09-13 Thread Merlin Moncure
On Fri, Sep 13, 2013 at 9:30 AM, Chris Travers wrote: > > > > On Fri, Sep 13, 2013 at 6:37 AM, Merlin Moncure wrote: >> >> >> >> It would certainly be better if we could straight up deserialize json >> into a nested structure. For now, my advise is to try and structure >> your json and the recei

Re: [GENERAL] Best way to populate nested composite type from JSON`

2013-09-13 Thread Chris Travers
On Fri, Sep 13, 2013 at 6:37 AM, Merlin Moncure wrote: > > > It would certainly be better if we could straight up deserialize json > into a nested structure. For now, my advise is to try and structure > your json and the receiving types/tables to not be nested. Using your > example, I was able

Re: [GENERAL] Best way to populate nested composite type from JSON`

2013-09-13 Thread Merlin Moncure
On Thu, Sep 12, 2013 at 7:25 PM, Chris Travers wrote: > > > > On Thu, Sep 12, 2013 at 8:47 AM, Merlin Moncure wrote: >> >> >> >> Can we see a hypothetical example? json best practices for me are to >> use standard tables and than serialize/deserialize json as it goes >> through the door and not

Re: [GENERAL] Best way to populate nested composite type from JSON`

2013-09-12 Thread Chris Travers
On Thu, Sep 12, 2013 at 8:47 AM, Merlin Moncure wrote: > > > Can we see a hypothetical example? json best practices for me are to > use standard tables and than serialize/deserialize json as it goes > through the door and not use nested composite types in your actual > table definitions. I thin

Re: [GENERAL] Best way to populate nested composite type from JSON`

2013-09-12 Thread Merlin Moncure
On Wed, Sep 11, 2013 at 11:55 PM, Chris Travers wrote: > Hi everyone; > > I have been starting to experiment with the JSON accessors in 9.3. I > immediately found that my preferred use, populating nested composite types, > is not supported. Also of course one cannot manipulate JSON nodes, which

[GENERAL] Best way to populate nested composite type from JSON`

2013-09-11 Thread Chris Travers
Hi everyone; I have been starting to experiment with the JSON accessors in 9.3. I immediately found that my preferred use, populating nested composite types, is not supported. Also of course one cannot manipulate JSON nodes, which leads to the question of how best to do this. I had some ideas: