aboutsummaryrefslogtreecommitdiffstats
path: root/db/db.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2022-09-02 14:47:08 -0700
committerAdam Soltys <[email protected]>2022-09-02 14:47:14 -0700
commit3161dd7ee95b6c7d70f8341298dd4fab84cda8b0 (patch)
tree16cd6c55d5dc481331b1e8b640d179f193e7ea13 /db/db.js
parent7a8d64833de8873afb92982b3f5bfff59b30c542 (diff)
downloadcoinos-server-3161dd7ee95b6c7d70f8341298dd4fab84cda8b0.tar.gz
coinos-server-3161dd7ee95b6c7d70f8341298dd4fab84cda8b0.zip
es6 migration
Diffstat (limited to 'db/db.js')
-rw-r--r--db/db.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/db/db.js b/db/db.js
new file mode 100644
index 00000000..914d049f
--- /dev/null
+++ b/db/db.js
@@ -0,0 +1,17 @@
+import Sequelize from '@sequelize/core';
+import dbOptions from '../config/knexfile.js';
+
+let { database, user, password, host } = dbOptions[process.env.NODE_ENV].connection;
+
+export default new Sequelize(
+ database,
+ user,
+ password,
+ {
+ host,
+ dialect: "mariadb",
+ logging: false,
+ dialectOptions: { multipleStatements: true, timezone: "Etc/GMT+7" },
+ }
+);
+