From 14c7b3fb039b13001dc1a0100f9f8d4375f1bdfe Mon Sep 17 00:00:00 2001 From: irfnrdh Date: Sun, 11 Feb 2024 15:04:27 +0700 Subject: [PATCH] update --- .env | 13 ++++++++++++- server/utils/db.instance.ts | 21 +++++++++++++++++++-- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/.env b/.env index 975eea7..5839e5e 100644 --- a/.env +++ b/.env @@ -1,4 +1,15 @@ API = 123456 DBNAME = "mydb" AUTH_ORIGIN = "https://localhost:3000" -AUTH_SECRET = "dfsdfsdf3f3f3453fdfsdfsdj2k3lj4k23j4lk2j3lk4j2lkjflkdsjflkjds" \ No newline at end of file +AUTH_SECRET = "dfsdfsdf3f3f3453fdfsdfsdj2k3lj4k23j4lk2j3lk4j2lkjflkdsjflkjds" + + + +POSTGRES_URL="postgres://default:TCOyQm6tM9RV@ep-lingering-smoke-a1v62b72-pooler.ap-southeast-1.aws.neon.tech:5432/verceldb?sslmode=require" +POSTGRES_PRISMA_URL="postgres://default:TCOyQm6tM9RV@ep-lingering-smoke-a1v62b72-pooler.ap-southeast-1.aws.neon.tech:5432/verceldb?sslmode=require&pgbouncer=true&connect_timeout=15" +POSTGRES_URL_NO_SSL="postgres://default:TCOyQm6tM9RV@ep-lingering-smoke-a1v62b72-pooler.ap-southeast-1.aws.neon.tech:5432/verceldb" +POSTGRES_URL_NON_POOLING="postgres://default:TCOyQm6tM9RV@ep-lingering-smoke-a1v62b72.ap-southeast-1.aws.neon.tech:5432/verceldb?sslmode=require" +POSTGRES_USER="default" +POSTGRES_HOST="ep-lingering-smoke-a1v62b72-pooler.ap-southeast-1.aws.neon.tech" +POSTGRES_PASSWORD="TCOyQm6tM9RV" +POSTGRES_DATABASE="verceldb" \ No newline at end of file diff --git a/server/utils/db.instance.ts b/server/utils/db.instance.ts index 30846a9..1b46de9 100644 --- a/server/utils/db.instance.ts +++ b/server/utils/db.instance.ts @@ -1,13 +1,30 @@ import { Sequelize } from "sequelize"; + +// SQLITE +// export const sequelize = new Sequelize({ +// dialect: "sqlite", +// storage: "./mydb.sqlite", +// logging: false, +// }); + + +// POSTGRES SQL + export const sequelize = new Sequelize({ - dialect: "sqlite", - storage: "./mydb.sqlite", + dialect: "postgres", + host: "ep-lingering-smoke-a1v62b72-pooler.ap-southeast-1.aws.neon.tech", // or your PostgreSQL host + port: 5432, // or your PostgreSQL port + username: "default", + password: "TCOyQm6tM9RV", + database: "verceldb", logging: false, }); +// MYSQL + // const { Sequelize } = require('sequelize'); // const sequelize = new Sequelize('database', 'username', 'password', {