postgres icon indicating copy to clipboard operation
postgres copied to clipboard

feat: sql.join

Open DanielFGray opened this issue 1 year ago • 8 comments

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

DanielFGray avatar Jun 27 '24 15:06 DanielFGray