Ayush Goyal
Ayush Goyal
Explore posts from servers
DTDrizzle Team
Created by Ayush Goyal on 8/12/2024 in #help
applying migrations...Error: getaddrinfo ENOTFOUND postgres
Hi Guys , I am using nextjs app router with drizzle with postgres and its working fine in development mode but when i am running it with docker compose up --build its giving me this error
[⣷] applying migrations...Error: getaddrinfo ENOTFOUND postgres
1.013 at /app/node_modules/pg-pool/index.js:45:11
1.013 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
1.013 at PgDialect.migrate (/app/node_modules/src/pg-core/dialect.ts:72:3)
1.013 at migrate (/app/node_modules/src/node-postgres/migrator.ts:10:2) {
1.013 errno: -3008,
1.013 code: 'ENOTFOUND',
1.013 syscall: 'getaddrinfo',
1.013 hostname: 'postgres'
1.013 }
[⣷] applying migrations...Error: getaddrinfo ENOTFOUND postgres
1.013 at /app/node_modules/pg-pool/index.js:45:11
1.013 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
1.013 at PgDialect.migrate (/app/node_modules/src/pg-core/dialect.ts:72:3)
1.013 at migrate (/app/node_modules/src/node-postgres/migrator.ts:10:2) {
1.013 errno: -3008,
1.013 code: 'ENOTFOUND',
1.013 syscall: 'getaddrinfo',
1.013 hostname: 'postgres'
1.013 }
the whole code can be found in this repo https://github.com/AyushiitrFreedom/bountpirac
1 replies
DTDrizzle Team
Created by Ayush Goyal on 8/10/2023 in #help
how to make a session using drizzle
import express from 'express';
import session from 'express-session';
import genFunc from 'connect-pg-simple';

const PostgresqlStore = genFunc(session);
const sessionStore = new PostgresqlStore({
conString: '<insert-connection-string-here>',
});

const app = express();
app.use(express.json());

app.use(session({
secret: 'secret',
resave: false,
saveUninitialized: false,
cookie: cookieOptions, // define cookieOptions
store: sessionStore
}));
import express from 'express';
import session from 'express-session';
import genFunc from 'connect-pg-simple';

const PostgresqlStore = genFunc(session);
const sessionStore = new PostgresqlStore({
conString: '<insert-connection-string-here>',
});

const app = express();
app.use(express.json());

app.use(session({
secret: 'secret',
resave: false,
saveUninitialized: false,
cookie: cookieOptions, // define cookieOptions
store: sessionStore
}));
this is how we make a session using postgress , i wanted to know how will we do that using drizzle-postgress
1 replies
DTDrizzle Team
Created by Ayush Goyal on 7/17/2023 in #help
Anyone who can give a example of this
1 replies