drizzle not showing columns

im not able to query my columns in drizzle using .query method. this is my drizzle config:
import { type Config } from "drizzle-kit";

import { env } from "@/env";

export default {
schema: "./src/server/db/schema",
dialect: "postgresql",
dbCredentials: {
url: env.DATABASE_URL,
},
out: "./src/server/db/migrations",
} satisfies Config;
import { type Config } from "drizzle-kit";

import { env } from "@/env";

export default {
schema: "./src/server/db/schema",
dialect: "postgresql",
dbCredentials: {
url: env.DATABASE_URL,
},
out: "./src/server/db/migrations",
} satisfies Config;
No description
1 Reply
astro
astroOP6mo ago
i fixed it nvm i was using a multi file schema(separate file for each table in db) just needed to create an index.ts in root of my schema folder and export all schemas
export * from "./auth";
export * from "./campaigns";
export * from "./newsletters";
export * from "./smtpServers";
export * from "./subscribers";
export * from "./auth";
export * from "./campaigns";
export * from "./newsletters";
export * from "./smtpServers";
export * from "./subscribers";
and then pass it to my db object
import { neon } from "@neondatabase/serverless";
import { drizzle } from "drizzle-orm/neon-http";
import * as schema from "./schema";

const sql = neon(process.env.DATABASE_URL!);
export const db = drizzle(sql, { schema });
import { neon } from "@neondatabase/serverless";
import { drizzle } from "drizzle-orm/neon-http";
import * as schema from "./schema";

const sql = neon(process.env.DATABASE_URL!);
export const db = drizzle(sql, { schema });
Want results from more Discord servers?
Add your server