ยฉ 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Teamโ€ข3y agoโ€ข
2 replies
Snoo

using postgres-js for connection

I am trying to setup drizzle with postgres-js package ( as document it be fastest). Referring to this doc:
https://orm.drizzle.team/docs/installation-and-db-connection/postgresql/postgresjs

How do i define schema using postgres-js ?? I tried import for table to my schema file and typescript shows error: Module '"drizzle-orm/postgres-js"' has no exported member ...

How can i import table and other types ?? shoud I use 'drizzle-orm/pg-core' package for schema and 'drizzle-orm/postgres-js' for my index.ts ??

schema.ts :
import { integer, pgEnum, pgTable, serial, uniqueIndex, varchar,boolean,text,timestamp } from 'drizzle-orm/postgres-js';
import { integer, pgEnum, pgTable, serial, uniqueIndex, varchar,boolean,text,timestamp } from 'drizzle-orm/postgres-js';


index .ts :
import { drizzle, PostgresJsDatabase } from 'drizzle-orm/postgres-js';
import postgres from 'postgres';

const connectionString = process.env.DATABASE_URL || "";

const queryClient = postgres(connectionString, { max: 10 });
const db: PostgresJsDatabase = drizzle(queryClient);
import { drizzle, PostgresJsDatabase } from 'drizzle-orm/postgres-js';
import postgres from 'postgres';

const connectionString = process.env.DATABASE_URL || "";

const queryClient = postgres(connectionString, { max: 10 });
const db: PostgresJsDatabase = drizzle(queryClient);
Drizzle TeamJoin
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
11,879Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Using postgres connection for cockroachdb
Drizzle TeamDTDrizzle Team / help
3y ago
Using one drizzle connection per request (Cloudflare + postgres)
Drizzle TeamDTDrizzle Team / help
9mo ago
inArray() using sql`` operator in JS and Postgres
Drizzle TeamDTDrizzle Team / help
3y ago
RDS/postgres.js workflow
Drizzle TeamDTDrizzle Team / help
3y ago