So I have this
test MySQL db with a table test1 with JSON datatype our_data:
'{\"cars\": {\"chev\": \"bolt\", \"ford\": \"explorer\", \"jeep\": \"ranger\"}}'
I can connect successfully to the base on if a select without JSON_KEYS
return a
string, however if I add a JSON_KEYS
I get:
SQL Connection to database established!
Connection Failed! Check output console
Column 'our_data' not found., 0
I'm pretty sure it's because JSON_KEYS(our_data) does not return a String Object!
I'm thinking I've got some parsing to do. But what return type does the select with JSON_KEYS return? And how does one parse an JSON OBJECT from a MySQL DB?
Is there a sassy myRs.getJSONTYPETHING("our_data") that returns the correct object? Do I have to cast the returned value? A million questions?
This completely new to me and I'm just testing whether it's a good idea to include JSON OBJECTS in a MySQL DB.
Ideas? Thoughts? Solutions? Directions? Bad Idea?!