multi-db-orm 2.1.20 → 2.1.22

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/engines/mysqldb.js +10 -2
  2. package/package.json +1 -1
@@ -32,7 +32,7 @@ class MySQLDB extends MultiDbORM {
32
32
  acquireTimeout: credentials.acquireTimeout || 10000,
33
33
  timeout: credentials.timeout || 60000
34
34
  });
35
-
35
+ this.db = this.pool
36
36
  this.pool.on('connection', (connection) => {
37
37
  if (this.loglevel > 1)
38
38
  console.log('MySQLDB: New connection acquired');
@@ -90,7 +90,15 @@ class MySQLDB extends MultiDbORM {
90
90
  }
91
91
  }
92
92
  }
93
- var query = `SELECT * FROM ${modelname} WHERE ${where} ${sort} ;`;
93
+ let limit = ''
94
+ let offset = ''
95
+ if(options?.limit){
96
+ limit = `LIMIT ${options.offset}`
97
+ }
98
+ if(options?.offset){
99
+ offset = `OFFSET ${options.offset}`
100
+ }
101
+ var query = `SELECT * FROM ${modelname} WHERE ${where} ${sort} ${limit} ${offset};`;
94
102
  return await this.run(query);
95
103
  }
96
104
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "multi-db-orm",
3
- "version": "2.1.20",
3
+ "version": "2.1.22",
4
4
  "description": "CRUD , Backup , Restore and Migration library for multiple databases",
5
5
  "main": "index.js",
6
6
  "dependencies": {