initialize sequalize with sqlite setup
This commit is contained in:
parent
db551f7e5b
commit
8a619b53e4
@ -1,2 +1,6 @@
|
|||||||
TOKEN=
|
TOKEN=
|
||||||
CLIENT=
|
CLIENT=
|
||||||
|
DB_PWD=
|
||||||
|
DB_NAME=
|
||||||
|
DB_HOST=
|
||||||
|
DB_USER=
|
||||||
|
15
database.js
Normal file
15
database.js
Normal 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
1312
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -15,7 +15,9 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"discord.js": "^14.14.1",
|
"discord.js": "^14.14.1",
|
||||||
"dotenv": "^16.3.1",
|
"dotenv": "^16.3.1",
|
||||||
"proxy-agent": "^6.3.1"
|
"proxy-agent": "^6.3.1",
|
||||||
|
"sequelize": "^6.35.2",
|
||||||
|
"sqlite3": "^5.1.7"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"eslint": "^8.56.0",
|
"eslint": "^8.56.0",
|
||||||
|
Loading…
Reference in New Issue
Block a user