We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi, I don't know if this request exists. But I search a way to build a select query with conditional arguments. Sample:
knex('mytable') .select('champ1','champ2','champ3') .where ('champ1','=',val1) .andWhere ('champ2','=',val2) .then{function(rows,err){ })
etc...
But if champ2 is empty or don't fill the condition I must duplicate the code without the andWhere
knex('mytable') .select('champ1','champ2','champ3') .where ('champ1','=',val1) .then{function(rows,err){ etc... })
If i give as value2 :'*', the query turn off. If you a reference, thanks. Franck
The text was updated successfully, but these errors were encountered:
QueryBuilder#modify
knex('table').select('col_a').modify(function (qb) { if (bValue) { qb.where('col_b', bValue); } }).then(...
Sorry, something went wrong.
it's perfect for me. Is there a forum ? Thanks, Franck
As far as I know github issues is the only forum for knex.
No branches or pull requests
Hi,
I don't know if this request exists. But I search a way to build a select query with conditional arguments.
Sample:
etc...
But if champ2 is empty or don't fill the condition
I must duplicate the code without the andWhere
If i give as value2 :'*', the query turn off.
If you a reference, thanks.
Franck
The text was updated successfully, but these errors were encountered: