How to add schemas to the DB object when using URL for DB connection
I'm using a URL to connect to my database and I cannot figure out the syntax for adding schemas to the DB instance This is how my config looks
import { drizzle, } from "drizzle-orm/mysql2";import * as schmea from "../drizzle/schema.ts";const databaseUrl = Bun.env.DATABASE_URL as string;export const db = drizzle(databaseUrl);
import { drizzle, } from "drizzle-orm/mysql2";import * as schmea from "../drizzle/schema.ts";const databaseUrl = Bun.env.DATABASE_URL as string;export const db = drizzle(databaseUrl);
I get a
Property 'tableExample' does not exist on type 'DrizzleTypeError<"Seems like the schema generic is missing - did you forget to add it to your DB type?">'
Property 'tableExample' does not exist on type 'DrizzleTypeError<"Seems like the schema generic is missing - did you forget to add it to your DB type?">'
error when trying to use db.query.tableExample.findFirst