Skip to content

Commit

Permalink
fix: Patched more Cloudflare jank
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-coster committed Nov 27, 2023
1 parent 3bca64f commit 6c5749c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions projects/site/src/lib/db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ import * as schema from './schema.js';
// create the connection
const connection = connect({
url: env.DATABASE_URL,
// NOTE: This is a workaround for some Cloudflare jank.
// See: https://github.com/planetscale/database-js/pull/102#issuecomment-1508219636
fetch: (url, init) => {
delete (init as any)["cache"]; // Remove cache header
return fetch(url, init);
}
});

export const db = drizzle(connection, { schema });

0 comments on commit 6c5749c

Please sign in to comment.