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 encountered this issue when using an ANY function as a replacement for an IN clause. I created a mocha test to illustrate the problem:
it('pg bind array using ANY clause with type cast', () => {
const query = 'SELECT id::int FROM user WHERE id=any(:idList::int[]) and born > :year;'
const data = {idList: [1, 2, 3], year: 2000}
const expected = {
text: 'SELECT id::int FROM user WHERE id=any($1::int[]) and born > $2;',
values: [[1, 2, 3], 2000]
};
assert.deepEqual(yesql.pg(query)(data), expected)
})