You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to implement this is my use case so I was wondering if its possible to add support for this.
Here is the scenario:
I am trying to pass dynamic object to where clause which has list of values for some of the properties.
So if I pass data like this
select().from('person').where({last_name: 'Rubble', codes: ['ABC' , 'XYZ'}).toString();
it will convert to
// SELECT * FROM person WHERE last_name = 'Rubble' and codes in ('ABC' , 'XYZ')
Reason for me to use it like this is due to I have dynamic input for table name and column values so this way it will be able to generate clause dynamically.
I was trying to implement this is my use case so I was wondering if its possible to add support for this.
Here is the scenario:
I am trying to pass dynamic object to where clause which has list of values for some of the properties.
So if I pass data like this
select().from('person').where({last_name: 'Rubble', codes: ['ABC' , 'XYZ'}).toString();
it will convert to
// SELECT * FROM person WHERE last_name = 'Rubble' and codes in ('ABC' , 'XYZ')
Reason for me to use it like this is due to I have dynamic input for table name and column values so this way it will be able to generate clause dynamically.
But current support is only for
equal
operator and notin
clause.https://github.com/CSNW/sql-bricks/blob/a004a72c17bc0010366bbd8cfeb5f1590db16c4e/sql-bricks.js#L975-L981
So above instead of
expressions.push(sql.equal(col, obj[col]));
I tried using is clause conditionally and it works fine.
Is it possible to support this?
I am also open to creating PR.
The text was updated successfully, but these errors were encountered: