Theo's Typesafe CultTTC
Theo's Typesafe Cult14mo ago
7 replies
LinnJS

Self hosted Postgres on Create t3 Turbo

I am low key struggling to convert create-t3-turbo db package from using Vercel Postgres to Railway postgres connection.

This is what I have now in my client.ts

import { drizzle } from "drizzle-orm/node-postgres";
import { Pool } from "pg";

import * as schema from "./schema";

const pool = new Pool({
  connectionString: process.env.POSTGRES_URL,
});

export const db = drizzle({ client: pool, schema });


I can run pnpm db:push and it works but all the types in tRPC are breaking when passing db for zod infrence. Would love help don't see the schma types coming through on DB being passed into the API package. This has to be an issue someone else has solved. Not seeing schmea notes in Drizzel postgres-node docs.

These are the only types coming back on the db var

{
    $client: Pool;
}
Was this page helpful?