Seems like the schema generic is missing - did you forget to add it to your DB type?

Hi, I cannot get it to work no matter what I tried.

Here's the db/index:

import { RDSDataClient } from "@aws-sdk/client-rds-data";
import { fromIni } from "@aws-sdk/credential-providers";
import { drizzle } from "drizzle-orm/postgres-js";
import postgres from "postgres";

import * as schema from "./schemas";

const queryClient = postgres(
  "postgres://postgres:postgrespassword@localhost:5433/postgres"
);

const db_dev = drizzle(queryClient, {
  logger: true,
  schema: { ...schema }
});

const rdsClient = new RDSDataClient({
  credentials: fromIni({ profile: process.env["PROFILE"] }),
  region: "us-east-1"
});

export const db =
  process.env.NAME === "Offline"
    ? db_dev
    : // @ts-ignore
      drizzle(rdsClient, {
        database: process.env["DATABASE"]!,
        secretArn: process.env["SECRET_ARN"]!,
        resourceArn: process.env["RESOURCE_ARN"]!
      });
Was this page helpful?