Re: [go-nuts] Returning a JSON object saved as a string in a database

2017-08-12 Thread Frits van Bommel
On Friday, August 11, 2017 at 6:43:39 AM UTC+2, Dmitriy Cherchenko wrote: > > Just to make sure: When marshalling a struct, will fields of > type json.RawMessage be ignored (simply inserted into the JSON object > without further processing)? > There's some *slight* processing: - a check that it'

Re: [go-nuts] Returning a JSON object saved as a string in a database

2017-08-10 Thread Dmitriy Cherchenko
Wow that appears to be exactly the answer I'm looking for! Thank you. Just to make sure: When marshalling a struct, will fields of type json.RawMessage be ignored (simply inserted into the JSON object without further processing)? On Thursday, August 10, 2017 at 7:27:17 PM UTC-7, Jakob Borg wro

Re: [go-nuts] Returning a JSON object saved as a string in a database

2017-08-10 Thread Jakob Borg
On 10 Aug 2017, at 22:11, Dmitriy Cherchenko mailto:dcherche...@gmail.com>> wrote: What is the best way to send the stringified JSON object from the database as JSON and not as a string-type value of a property in the bigger JSON object the server is responding with? Do you mean like this? ht

Re: [go-nuts] Returning a JSON object saved as a string in a database

2017-08-10 Thread Dmitriy Cherchenko
But then if the JSON is sent as a string property of a bigger object, it'll have to be parsed by JavaScript on the browser side. That is undesirable. On Thursday, August 10, 2017 at 1:21:54 PM UTC-7, Shawn Milochik wrote: > > On Thu, Aug 10, 2017 at 4:20 PM, Dmitriy Cherchenko > wrote: > >> Hi S

Re: [go-nuts] Returning a JSON object saved as a string in a database

2017-08-10 Thread Shawn Milochik
On Thu, Aug 10, 2017 at 4:20 PM, Dmitriy Cherchenko wrote: > Hi Shawn, > > Thank you for your quick reply! > > I’m not having any issues retrieving data from the database. I’m only > concerned that the unmarshalling and marshalling processes seem needless > and a little risky especially on big JS

Re: [go-nuts] Returning a JSON object saved as a string in a database

2017-08-10 Thread Dmitriy Cherchenko
Hi Shawn, Thank you for your quick reply! I’m not having any issues retrieving data from the database. I’m only concerned that the unmarshalling and marshalling processes seem needless and a little risky especially on big JSON objects. On Thursday, August 10, 2017 at 1:17:02 PM UTC-7, Shawn M

Re: [go-nuts] Returning a JSON object saved as a string in a database

2017-08-10 Thread Shawn Milochik
Seems like something that should "just work." Are you having a problem with this? If so, please show some code. A string is a string -- if you insert a base64-encoded value (or JSON, or YAML) into a database varchar or text field, you should get the identical string back out, character for charact