mirror of
https://github.com/FranP-code/create-better-t-stack.git
synced 2025-10-12 23:52:15 +00:00
add cloudflare workers support (#326)
This commit is contained in:
@@ -1,3 +0,0 @@
|
||||
import { drizzle } from "drizzle-orm/node-postgres";
|
||||
|
||||
export const db = drizzle(process.env.DATABASE_URL || "");
|
||||
12
apps/cli/templates/db/drizzle/postgres/src/db/index.ts.hbs
Normal file
12
apps/cli/templates/db/drizzle/postgres/src/db/index.ts.hbs
Normal file
@@ -0,0 +1,12 @@
|
||||
{{#if (or (eq runtime "bun") (eq runtime "node"))}}
|
||||
import { drizzle } from "drizzle-orm/node-postgres";
|
||||
|
||||
export const db = drizzle(process.env.DATABASE_URL || "");
|
||||
{{/if}}
|
||||
|
||||
{{#if (eq runtime "workers")}}
|
||||
import { drizzle } from "drizzle-orm/node-postgres";
|
||||
import { env } from "cloudflare:workers";
|
||||
|
||||
export const db = drizzle(env.DATABASE_URL || "");
|
||||
{{/if}}
|
||||
Reference in New Issue
Block a user