@less-is-more/less-js 1.4.30 → 1.4.31-0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/db.js +7 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@less-is-more/less-js",
3
- "version": "1.4.30",
3
+ "version": "1.4.31-0",
4
4
  "description": "Fast develop kit for nodejs",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
package/src/db.js CHANGED
@@ -12,12 +12,14 @@ module.exports = class Db {
12
12
  static SQL_TYPE_UPDATE = Sequelize.QueryTypes.UPDATE;
13
13
  static SQL_TYPE_DELETE = Sequelize.QueryTypes.DELETE;
14
14
  static Op = Sequelize.Op;
15
+ static #logger;
15
16
 
16
- static init(host, database, user, password) {
17
+ static init(host, database, user, password, logger = false) {
17
18
  this.#host = host;
18
19
  this.#database = database;
19
20
  this.#user = user;
20
21
  this.#password = password;
22
+ this.#logger = logger;
21
23
  }
22
24
 
23
25
  static getInstance() {
@@ -40,6 +42,10 @@ module.exports = class Db {
40
42
  min: 0,
41
43
  idle: 10000,
42
44
  },
45
+ logging: this.#logger ? console.log : false,
46
+ dialectOptions: {
47
+ compress: true,
48
+ },
43
49
  }
44
50
  );
45
51
  } else {