S
Supabase5w ago
b

Not connecting to my database? Timeout error

First time using supabase. I dont understand why but i cant connect to my db. I don't think its the code since the command
nc -vz db.v.supabase.co 5432
nc -vz db.v.supabase.co 5432
yields me
nc: connect to db.v.supabase.co (7#.2##.1##.2##) port 5432 (tcp) failed: Connection timed out
nc: connect to db.v.supabase.co (7#.2##.1##.2##) port 5432 (tcp) failed: Connection timed out
No resrtcitions are applied to my db settings I have enforce ssl also turned off. But just incase my code is:
export const AppDataSource = new DataSource({
type: 'postgres',
url: process.env.DATABASE_URL, //postgres://postgres:mypassword@db.v.supabase.co:5432/postgres
synchronize: true,
logging: true,
entities: ['src/types/**/*.ts'],
});
export const AppDataSource = new DataSource({
type: 'postgres',
url: process.env.DATABASE_URL, //postgres://postgres:mypassword@db.v.supabase.co:5432/postgres
synchronize: true,
logging: true,
entities: ['src/types/**/*.ts'],
});
which is placed in a file called db.ts which is what is used to make the connection. im almost 90% sure its my database settings that are messing me up but idk what.
3 Replies
inder
inder5w ago
https://supabase.com/docs/guides/database/connecting-to-postgres#direct-connection Try with the session pooler connection string. you'll find it in the connect tab
No description
b
bOP5w ago
Thank you this worked but also i noticed i had the wrong env name for uri but yeah this fixed it woo how do i mark this solved
inder
inder5w ago
I think you can edit the tags

Did you find this page helpful?