I've got a use-case where it would be great to have the following functionality:
OR functionality:
seneca.make$('foo').list({col1: 'val', or$: {col1: 'val2'}}, function (err, result) {
... SELECT * FROM foo where col1 = 'val' OR col1 = 'val2';
});
IN functionality
seneca.make$('foo').list({col1: {in$: ['val1', 'val2']}}, function (err, result) {
... SELECT * FROM foo where col1 IN ('val1', 'val2');
});
This could be doubled up to allow support of the @> JSONB operator if the value of the in$ key is an object:
seneca.make$('foo').list({json: {in$: {something: 'in-json'}}}, function (err, result) {
... SELECT * FROM foo where json @> '{"something": "in-json"}';
});
I'm going to have a crack at getting this working since I need it. Are there any suggestions / comments on the above - It would be great to be able to submit a pull request once I've got it working so thought I'd see what you guys think.
I've gone a different direction, and started using knex.js as a query builder, which I just use to wire up the entity save/load/delete actions to my custom written queries.
I've got a use-case where it would be great to have the following functionality:
OR functionality:
IN functionality
This could be doubled up to allow support of the
@>
JSONB operator if the value of thein$
key is an object:I'm going to have a crack at getting this working since I need it. Are there any suggestions / comments on the above - It would be great to be able to submit a pull request once I've got it working so thought I'd see what you guys think.