Skip to content

Commit

Permalink
Revert "fix: pass query_ids as parameter to prevent SQL injection (#16)"
Browse files Browse the repository at this point in the history
This reverts commit cd1f454.
  • Loading branch information
Walkeezy committed Oct 22, 2024
1 parent cd1f454 commit 7ea911b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/cache-tags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,8 @@ export const queriesReferencingCacheTags = async (cacheTags: CacheTag[]): Promis
if (!cacheTags?.length) {
return [];
}
const placeholders = cacheTags.map(() => '?').join(', ');
const { rows }: { rows: { query_id: string }[] } = await sql.query(
`SELECT DISTINCT query_id FROM query_cache_tags WHERE cache_tag IN (${placeholders})`,
cacheTags,
`SELECT DISTINCT query_id FROM query_cache_tags WHERE cache_tag IN (${cacheTags.map((cacheTag) => `'${cacheTag}'`).join(', ')})`,
);

return rows.map((row) => row.query_id);
Expand Down

0 comments on commit 7ea911b

Please sign in to comment.