Closed johnsonthedev closed 5 years ago
Second parameter should be sql token, i.e. sql` AND `
.
const booleanExpression = sql.booleanExpression(
Object
.entries(booleanExpressionValues)
.map(([key, value]) => {
return sql`{sql.identifier([key])} = ${value}`;
}),
sql` AND `
);
THX!!!! Works!!
sql.booleanExpression
was removed in favour of sql.join
but the article has not been updated.
I use your booleanExpression snipped from Slonik-utilities and wanted to migrate it to new join function but it doesn't work. Is this a bug or am I doing it wrong ?