Drizzle ORM + Supabase Enforce SSL

I'm trying to connect with a direct pool connection (transaction mode). I'm deploying to Supabase Deno functions. This is my URL: postgres://postgres.{user}:[YOUR-PASSWORD]@aws-0-us-west-1.pooler.supabase.com:6543/postgres const client = postgres(url, { prepare: false }); const db = drizzle(client); Supabase returns "SSL connection is required" I tried appending the sslmode in the url, but nothing has worked. ?sslmode=no-verify,strict,verify-full etc. How can I connect to Supabase with Drizzle using SSL?
4 Replies
nowifi4u3d ago
Any advice on connecting to supabase when SSL is enabled? · supabas...
I am using drizzle and drizzle-kit to run migrations against my supabase DB. I have SSL enforced, and can connect via psql (both with and without the SSL CLI flags, this doesn't make sense to m...
luis3d ago
Thanks! I saw this, but the edge function is deployed to supabase. As far as I understand, the edge functions are already pre-configured: https://supabase.com/docs/guides/functions/connect-to-postgres#ssl-connections
Connecting directly to Postgres | Supabase Docs
Connecting to Postgres from Edge Functions.
luis3d ago
I tried the Deno Postgres client. It works in Supabase Edge Functions without any additional config. https://github.com/denodrivers/postgres The Postgres client used by Drizzle might not be picking up the TLS config. const client = new Client({ user: "z", database: "postgres", hostname: "aws-0-us-west-1.pooler.supabase.com", port: 6543, password: "z", }); await client.connect(); const result = await client .queryArray'SELECT ID FROM table WHERE ID = 1'; console.log(result.rows);
GitHub - denodrivers/postgres: PostgreSQL driver for Deno
PostgreSQL driver for Deno. Contribute to denodrivers/postgres development by creating an account on GitHub.
luis3d ago
Adding NODE_EXTRA_CA_CERTS="./server/certs/prod-ca-2021.crt" to the envs didn't work: I got this error in the edge function: path not found server/certs/prod-ca-2021.crt: readfile './server/certs/prod-ca-2021.crt'
Want results from more Discord servers?
Add your server
More Posts
Can't infer relationship one-to-oneI'm trying to follow the relationship docs to set a relationship between a user and a role, but I'm Cannot set null value to FK - null value in column "X" of relation "Y" violates not-null constraintHi everyone, I'm trying to create a userId column, fk to users.id but optional (so I don't set the nDrizzle complains when I'm trying to insert into a table.I have a schema that looks like this: ```ts export const Organization = pGtable( "Organization",Is it possible to use the Query API to select many-to-many relations?In prisma I can do this to select the entities from the "other side" of a many-to-many join: ```jsonHow can I configure `drizzle-kit introspect` to generate a schema with a schema?I'm using [this](https://orm.drizzle.team/learn/migrate/migrate-from-prisma) guide to migrate from PCan't Push Schema to AWS Aurora - Is My Config Correct?Hi guys! I'm moving from Vercel Postgres to AWS Aurora and I'm just trying to `npx drizzle-kit pusNo matter what I try, npm run migrate defaults to my .env file. Npm run generate works just fine.Hey, I am trying to set dynamic variable paths. When I run npm run migrate, it always defaults to myconstruction a dynamic query builder generically ?Ok i'm not really sure how to ask this but I'm trying to allow a user the ability in UI to build outconflicting peer dependency when installing drizzle-ormI am trying to install drizzle orm in a fresh install of Nextjs and have the following error presentDatabase with no passwordOn my local machine for development, i have a psql database with no password. When i do '' for the p