Effect CommunityEC
Effect Community13mo ago
10 replies
johtso

Safe Interpolation with SQL Query in TypeScript

Does this look right? Is it not possible to do safe interpolation here?

${sql.and([
  'sov.ordertype = 2',
  days ? sql`NOW() - INTERVAL '${sql.unsafe(days.toString())} days' <= sov.OrderTime` : sql`TRUE`
])}
Was this page helpful?