objection.js
objection.js copied to clipboard
JSON support for mysql and sqlite3
ref()
implementation and updating internal attribute of JSON column should be dialect specific and tests be changed to be run with all dialects.
Any progress with this issue? May I offer help?
Thanks.
@danielyogel help is very much welcome. I'm not going to implement this unless I need this functionality at some point or I get really bored with my life and other projects I'm working on.
Hi Does this mean that currently for JSON query support I have to use postgresql ? or is it possible to do it with mysql with raw queries ?
Does this mean that currently for JSON query support I have to use postgresql ? or is it possible to do it with mysql with raw queries ?
It's possible to use raw queries to do this. Here's an example that gets an id and a value "foo" from a MySQL JSON field "object."
Model .query().select(['id', raw("object
->'$.foo' AS foo")])
That said, this feature prompted me to look deeper into PostgreSQL, and I came away with the feeling that for my needs (a combination of relational tables and noSQL style data) it was ultimately a better fit than MySQL.
I'm not usually one to shake up my architecture for a piece of software. But I'm looking forward to seeing how this goes.