T
TanStack4d ago
genetic-orange

How do I connect to Hyperdrive using Tanstack Start?

Hi, I have the following but I can't access my Hyperdrive binding from src/db/index.ts. import { drizzle } from 'drizzle-orm/node-postgres' import { Client } from 'pg' import * as schema from './schema.ts' const client = new Client({ connectionString: process.env.HYPERDRIVE.connectionString, }) export const db = drizzle(client, { schema })
1 Reply
genetic-orange
genetic-orangeOP4d ago
Ahh silly me it needs an import import { env } from 'cloudflare:workers'

Did you find this page helpful?