postgres
postgres copied to clipboard
feat: sql.join
closes #807, to add sql.join:
let dynamicFilters = [
sql`somecol = ${somevalue}`,
sql`col2 = ${v2}`
];
const dynamicColumns = [sql('somecol'), sql('col2')];
await sql`
select ${sql.join(sql`, `, dynamicColumns)} from t
where ${sql.join(sql` and `, dynamicFilters)};
`;
i'm not 100% sure the types are right, and I couldn't get the tests to run, so those probably need some work