continuing on with our jsonb efforts
we have inserts working, we have select all or select by id working
now a select on a jsonb field is not working
table users => create table (id primary key, data jsonb)
insert into users (data) values ({"email": "[email protected]", "role":"user"});
this works in postgresq psql
select * from users where data @> '{"email":"[email protected]"}';
=> id .... data {"email":"[email protected]", "role": "user"}
we've created a function to get a user based on email
def get_user(email)
users = DB.db['select * from signups where data @> \'{"email":" ' +
email + '"}\' '].all
end
==> returns nil having no luck trying to get this to work - any ideas ?
actually it would seem easier that if we are using postgres jsonb as a
nosql db that we don't really need an ORM and could just use the ruby pg
driver to make jsonb calls but this hasn't worked - for whatever reason,
sequel seems to have better jsonb support to return jsonb data
--
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.