Skip to content

Commit

Permalink
feat: add truncate method (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
Walkeezy authored Jan 7, 2025
1 parent e19c5c9 commit 94f4214
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/cache-tags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,11 @@ export const deleteQueries = async (queryIds: string[]) => {
}
await sql.query(`DELETE FROM query_cache_tags WHERE query_id IN (${queryIds.map((id) => `'${id}'`).join(', ')})`);
};

/**
* Wipes out all cache tags from the database.
*/

export async function truncateCacheTags() {
await sql.query('DELETE FROM query_cache_tags');
}

0 comments on commit 94f4214

Please sign in to comment.