GORM with MemSQL json query

240 Views Asked by At

MemSQL has the ability to support JSON Query. Is GORM able to perform JSON query, or it is a must to write SQL in my application?

1

There are 1 best solutions below

0
On

You can set the sqlType in the static mapping to match the MemSQL type 'JSON':

class Entity {
    String info

    static mapping = {
        info sqlType: 'JSON'
    }
}

Then you can push JSON data in doing something like this:

new Entity(info:'{"foo":"bar"}').save()