initialize sequalize with sqlite setup

This commit is contained in:
Baipyrus 2024-01-29 00:30:33 +01:00
parent db551f7e5b
commit 8a619b53e4
4 changed files with 1315 additions and 22 deletions

View File

@ -1,2 +1,6 @@
TOKEN=
CLIENT=
CLIENT=
DB_PWD=
DB_NAME=
DB_HOST=
DB_USER=

15
database.js Normal file
View File

@ -0,0 +1,15 @@
import { Sequelize } from 'sequelize';
import { config } from 'dotenv';
config();
const { DB_NAME, DB_USER, DB_PWD, DB_HOST } = process.env;
const sequelize = new Sequelize(DB_NAME, DB_USER, DB_PWD, {
storage: `${DB_NAME}.sqlite`,
dialect: 'sqlite',
logging: false,
host: DB_HOST,
});
sequelize.sync();
export { sequelize };

1312
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -15,7 +15,9 @@
"dependencies": {
"discord.js": "^14.14.1",
"dotenv": "^16.3.1",
"proxy-agent": "^6.3.1"
"proxy-agent": "^6.3.1",
"sequelize": "^6.35.2",
"sqlite3": "^5.1.7"
},
"devDependencies": {
"eslint": "^8.56.0",