tspace-mysql 1.1.6 → 1.1.7
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/dist/lib/tspace/DB.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AbstractModel } from './AbstractModel';
|
|
2
2
|
import { Relation, Pagination, RelationQuery } from './Interface';
|
|
3
3
|
declare class Model extends AbstractModel {
|
|
4
|
-
|
|
4
|
+
[key: string]: any;
|
|
5
5
|
constructor();
|
|
6
6
|
/**
|
|
7
7
|
*
|
|
@@ -22,13 +22,13 @@ declare class Model extends AbstractModel {
|
|
|
22
22
|
*/
|
|
23
23
|
usePrimaryKey(primary: string): this;
|
|
24
24
|
/**
|
|
25
|
-
* Assign in model uuid when creating
|
|
26
|
-
* @param {string?} column [column=uuid] custom column replace this
|
|
25
|
+
* Assign in model generate uuid when creating
|
|
26
|
+
* @param {string?} column [column=uuid] make new name column for custom column replace uuid with this
|
|
27
27
|
* @return {this} this
|
|
28
28
|
*/
|
|
29
29
|
useUUID(column?: string): this;
|
|
30
30
|
/**
|
|
31
|
-
* Assign in model console.log sql statement
|
|
31
|
+
* Assign in model console.log raw sql when fetching query statement
|
|
32
32
|
* @return {this} this
|
|
33
33
|
*/
|
|
34
34
|
useDebug(): this;
|
|
@@ -51,8 +51,8 @@ declare class Model extends AbstractModel {
|
|
|
51
51
|
*
|
|
52
52
|
* Assign timestamp when insert || updated created_at and update_at in table
|
|
53
53
|
* @param {object} timestampFormat
|
|
54
|
-
* @property {string} timestampFormat.createdAt - change column
|
|
55
|
-
* @property {string} timestampFormat.updatedAt - change column
|
|
54
|
+
* @property {string} timestampFormat.createdAt - change new name column replace by default [created at]
|
|
55
|
+
* @property {string} timestampFormat.updatedAt - change new name column replace by default updated at
|
|
56
56
|
* @return {this} this
|
|
57
57
|
*/
|
|
58
58
|
useTimestamp(timestampFormat?: {
|
package/dist/lib/tspace/Model.js
CHANGED
|
@@ -9,7 +9,6 @@ const AbstractModel_1 = require("./AbstractModel");
|
|
|
9
9
|
const DB_1 = require("./DB");
|
|
10
10
|
const ProxyHandler_1 = require("./ProxyHandler");
|
|
11
11
|
class Model extends AbstractModel_1.AbstractModel {
|
|
12
|
-
tableName;
|
|
13
12
|
constructor() {
|
|
14
13
|
super();
|
|
15
14
|
/**
|
|
@@ -53,8 +52,8 @@ class Model extends AbstractModel_1.AbstractModel {
|
|
|
53
52
|
return this;
|
|
54
53
|
}
|
|
55
54
|
/**
|
|
56
|
-
* Assign in model uuid when creating
|
|
57
|
-
* @param {string?} column [column=uuid] custom column replace this
|
|
55
|
+
* Assign in model generate uuid when creating
|
|
56
|
+
* @param {string?} column [column=uuid] make new name column for custom column replace uuid with this
|
|
58
57
|
* @return {this} this
|
|
59
58
|
*/
|
|
60
59
|
useUUID(column) {
|
|
@@ -64,7 +63,7 @@ class Model extends AbstractModel_1.AbstractModel {
|
|
|
64
63
|
return this;
|
|
65
64
|
}
|
|
66
65
|
/**
|
|
67
|
-
* Assign in model console.log sql statement
|
|
66
|
+
* Assign in model console.log raw sql when fetching query statement
|
|
68
67
|
* @return {this} this
|
|
69
68
|
*/
|
|
70
69
|
useDebug() {
|
|
@@ -103,8 +102,8 @@ class Model extends AbstractModel_1.AbstractModel {
|
|
|
103
102
|
*
|
|
104
103
|
* Assign timestamp when insert || updated created_at and update_at in table
|
|
105
104
|
* @param {object} timestampFormat
|
|
106
|
-
* @property {string} timestampFormat.createdAt - change column
|
|
107
|
-
* @property {string} timestampFormat.updatedAt - change column
|
|
105
|
+
* @property {string} timestampFormat.createdAt - change new name column replace by default [created at]
|
|
106
|
+
* @property {string} timestampFormat.updatedAt - change new name column replace by default updated at
|
|
108
107
|
* @return {this} this
|
|
109
108
|
*/
|
|
110
109
|
useTimestamp(timestampFormat) {
|
|
@@ -1235,7 +1234,7 @@ class Model extends AbstractModel_1.AbstractModel {
|
|
|
1235
1234
|
relationModel.localKey == null,
|
|
1236
1235
|
relationModel.foreignKey == null,
|
|
1237
1236
|
relation === this.$constants('RELATIONSHIP').belongsTo
|
|
1238
|
-
].every(
|
|
1237
|
+
].every(r => r);
|
|
1239
1238
|
if (checkRelationIsBelongsTo) {
|
|
1240
1239
|
foreignKey = localKey;
|
|
1241
1240
|
localKey = this._valuePattern([
|