We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 39b352e commit 70f905eCopy full SHA for 70f905e
docs/content/1.docs/3.recipes/5.postgres.md
@@ -117,7 +117,8 @@ import type { Hyperdrive } from '@cloudflare/workers-types'
117
import postgres from 'postgres'
118
119
export function usePostgres() {
120
- const hyperdrive = process.env.POSTGRES as Hyperdrive | undefined
+ // @ts-expect-error globalThis.__env__ is not defined
121
+ const hyperdrive = process.env.POSTGRES || globalThis.__env__?.POSTGRES || globalThis.POSTGRES as Hyperdrive | undefined
122
const dbUrl = hyperdrive?.connectionString || process.env.NUXT_POSTGRES_URL
123
if (!dbUrl) {
124
throw createError('Missing `POSTGRES` hyperdrive binding or `NUXT_POSTGRES_URL` env variable')
0 commit comments