@axiosleo/orm-mysql 0.10.11 → 0.10.12

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.
package/bin/orm-mysql.js CHANGED
@@ -9,7 +9,7 @@ const app = new App({
9
9
  name: 'MySQL ORM CLI',
10
10
  desc: 'migrate, model, seed, etc.',
11
11
  bin: 'orm-mysql',
12
- version: '0.10.11',
12
+ version: '0.10.12',
13
13
  commands_dir: path.join(__dirname, '../commands'),
14
14
  });
15
15
 
package/index.d.ts CHANGED
@@ -1,12 +1,12 @@
1
1
  import {
2
- Pool,
3
- OkPacket,
4
2
  Connection,
3
+ ConnectionOptions,
4
+ OkPacket,
5
+ Pool,
5
6
  PoolOptions,
6
7
  QueryOptions,
7
- RowDataPacket,
8
8
  ResultSetHeader,
9
- ConnectionOptions
9
+ RowDataPacket
10
10
  } from 'mysql2';
11
11
 
12
12
  import {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axiosleo/orm-mysql",
3
- "version": "0.10.11",
3
+ "version": "0.10.12",
4
4
  "description": "MySQL ORM tool",
5
5
  "keywords": [
6
6
  "mysql",
package/src/builder.js CHANGED
@@ -51,16 +51,16 @@ class Builder {
51
51
  }
52
52
  return attr;
53
53
  });
54
- emit(tmp, `SELECT ${attrs.length ? attrs.map((a) => this._buildFieldKey(a)).join(',') : '*'} FROM ${this._buildTables(options.tables)}`);
55
- emit(tmp, this._buildJoins(options.joins));
56
- emit(tmp, this._buildCondition(options.conditions));
57
- emit(tmp, this._buildOrders(options.orders));
58
54
  if (options.having && options.having.length && !options.groupField.length) {
59
55
  throw new Error('having is not allowed without "GROUP BY"');
60
56
  }
57
+ emit(tmp, `SELECT ${attrs.length ? attrs.map((a) => this._buildFieldKey(a)).join(',') : '*'} FROM ${this._buildTables(options.tables)}`);
58
+ emit(tmp, this._buildJoins(options.joins));
59
+ emit(tmp, this._buildCondition(options.conditions));
61
60
  emit(tmp, this._buildGroupField(options.groupField));
62
61
  emit(tmp, this._buildPagination(options.pageLimit, options.pageOffset));
63
62
  emit(tmp, this._buildHaving(options.having));
63
+ emit(tmp, this._buildOrders(options.orders));
64
64
  sql = tmp.join(' ');
65
65
  if (options.suffix) {
66
66
  sql += ' ' + options.suffix;
package/src/query.js CHANGED
@@ -6,7 +6,8 @@ const is = require('@axiosleo/cli-tool/src/helper/is');
6
6
 
7
7
  const optType = [
8
8
  '=', '!=', '>', '<', '>=', '<=',
9
- 'LIKE', 'NOT LIKE', 'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN', 'IS', 'IS NOT', 'REGEXP', 'NOT REGEXP', 'AND', 'OR', 'GROUP', 'CONTAIN', 'NOT CONTAIN', 'OVERLAPS', 'NOT OVERLAPS'
9
+ 'LIKE', 'NOT LIKE', 'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN', 'IS', 'IS NOT',
10
+ 'REGEXP', 'NOT REGEXP', 'AND', 'OR', 'GROUP', 'CONTAIN', 'NOT CONTAIN', 'OVERLAPS', 'NOT OVERLAPS'
10
11
  ];
11
12
 
12
13
  function joinOn(table, on, options = {}) {