oak-db 2.2.5 → 2.2.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/README.md +36 -36
- package/lib/MySQL/connector.d.ts +15 -15
- package/lib/MySQL/connector.js +124 -124
- package/lib/MySQL/store.d.ts +32 -32
- package/lib/MySQL/store.js +401 -404
- package/lib/MySQL/translator.d.ts +105 -105
- package/lib/MySQL/translator.js +780 -776
- package/lib/MySQL/types/Configuration.d.ts +11 -11
- package/lib/MySQL/types/Configuration.js +2 -2
- package/lib/index.d.ts +2 -2
- package/lib/index.js +4 -4
- package/lib/sqlTranslator.d.ts +52 -52
- package/lib/sqlTranslator.js +895 -895
- package/lib/types/Translator.js +1 -1
- package/package.json +36 -36
package/README.md
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
### 3 分钟了解如何进入开发
|
|
2
|
-
|
|
3
|
-
欢迎使用云效 Codeup,通过阅读以下内容,你可以快速熟悉 Codeup ,并立即开始今天的工作。
|
|
4
|
-
|
|
5
|
-
### 提交**文件**
|
|
6
|
-
|
|
7
|
-
首先,你需要了解在 Codeup 中如何提交代码文件,跟着文档「[__提交第一行代码__](https://thoughts.aliyun.com/sharespace/5e8c37eb546fd9001aee8242/docs/5e8c37e7546fd9001aee81fd)」一起操作试试看吧。
|
|
8
|
-
|
|
9
|
-
### 开启扫描
|
|
10
|
-
|
|
11
|
-
开发过程中,为了更好的管理你的代码资产,Codeup 内置了「[__代码规约扫描__](https://thoughts.aliyun.com/sharespace/5e8c37eb546fd9001aee8242/docs/5e8c37e8546fd9001aee821c)」和「[__敏感信息检测__](https://thoughts.aliyun.com/sharespace/5e8c37eb546fd9001aee8242/docs/5e8c37e8546fd9001aee821b)」服务,你可以在代码库设置-集成与服务中一键开启,开启后提交或合并请求的变更将自动触发扫描,并及时提供结果反馈。
|
|
12
|
-
|
|
13
|
-

|
|
14
|
-
|
|
15
|
-

|
|
16
|
-
|
|
17
|
-
### 代码评审
|
|
18
|
-
|
|
19
|
-
功能开发完毕后,通常你需要发起「[__代码合并和评审__](https://thoughts.aliyun.com/sharespace/5e8c37eb546fd9001aee8242/docs/5e8c37e8546fd9001aee8216)」,Codeup 支持多人协作的代码评审服务,你可以通过「[__保护分支__](https://thoughts.aliyun.com/sharespace/5e8c37eb546fd9001aee8242/docs/5e8c37e9546fd9001aee8221)」策略及「[__合并请求设置__](https://thoughts.aliyun.com/sharespace/5e8c37eb546fd9001aee8242/docs/5e8c37e9546fd9001aee8224)」对合并过程进行流程化管控,同时提供 WebIDE 在线代码评审及冲突解决能力,让你的评审过程更加流畅。
|
|
20
|
-
|
|
21
|
-

|
|
22
|
-
|
|
23
|
-

|
|
24
|
-
|
|
25
|
-
### 编写文档
|
|
26
|
-
|
|
27
|
-
项目推进过程中,你的经验和感悟可以直接记录到 Codeup 代码库的「[__文档__](https://thoughts.aliyun.com/sharespace/5e8c37eb546fd9001aee8242/docs/5e8c37e8546fd9001aee8213)」内,让智慧可视化。
|
|
28
|
-
|
|
29
|
-

|
|
30
|
-
|
|
31
|
-
### 成员协作
|
|
32
|
-
|
|
33
|
-
是时候邀请成员一起编写卓越的代码工程了,请点击右上角「成员」邀请你的小伙伴开始协作吧!
|
|
34
|
-
|
|
35
|
-
### 更多
|
|
36
|
-
|
|
1
|
+
### 3 分钟了解如何进入开发
|
|
2
|
+
|
|
3
|
+
欢迎使用云效 Codeup,通过阅读以下内容,你可以快速熟悉 Codeup ,并立即开始今天的工作。
|
|
4
|
+
|
|
5
|
+
### 提交**文件**
|
|
6
|
+
|
|
7
|
+
首先,你需要了解在 Codeup 中如何提交代码文件,跟着文档「[__提交第一行代码__](https://thoughts.aliyun.com/sharespace/5e8c37eb546fd9001aee8242/docs/5e8c37e7546fd9001aee81fd)」一起操作试试看吧。
|
|
8
|
+
|
|
9
|
+
### 开启扫描
|
|
10
|
+
|
|
11
|
+
开发过程中,为了更好的管理你的代码资产,Codeup 内置了「[__代码规约扫描__](https://thoughts.aliyun.com/sharespace/5e8c37eb546fd9001aee8242/docs/5e8c37e8546fd9001aee821c)」和「[__敏感信息检测__](https://thoughts.aliyun.com/sharespace/5e8c37eb546fd9001aee8242/docs/5e8c37e8546fd9001aee821b)」服务,你可以在代码库设置-集成与服务中一键开启,开启后提交或合并请求的变更将自动触发扫描,并及时提供结果反馈。
|
|
12
|
+
|
|
13
|
+

|
|
14
|
+
|
|
15
|
+

|
|
16
|
+
|
|
17
|
+
### 代码评审
|
|
18
|
+
|
|
19
|
+
功能开发完毕后,通常你需要发起「[__代码合并和评审__](https://thoughts.aliyun.com/sharespace/5e8c37eb546fd9001aee8242/docs/5e8c37e8546fd9001aee8216)」,Codeup 支持多人协作的代码评审服务,你可以通过「[__保护分支__](https://thoughts.aliyun.com/sharespace/5e8c37eb546fd9001aee8242/docs/5e8c37e9546fd9001aee8221)」策略及「[__合并请求设置__](https://thoughts.aliyun.com/sharespace/5e8c37eb546fd9001aee8242/docs/5e8c37e9546fd9001aee8224)」对合并过程进行流程化管控,同时提供 WebIDE 在线代码评审及冲突解决能力,让你的评审过程更加流畅。
|
|
20
|
+
|
|
21
|
+

|
|
22
|
+
|
|
23
|
+

|
|
24
|
+
|
|
25
|
+
### 编写文档
|
|
26
|
+
|
|
27
|
+
项目推进过程中,你的经验和感悟可以直接记录到 Codeup 代码库的「[__文档__](https://thoughts.aliyun.com/sharespace/5e8c37eb546fd9001aee8242/docs/5e8c37e8546fd9001aee8213)」内,让智慧可视化。
|
|
28
|
+
|
|
29
|
+

|
|
30
|
+
|
|
31
|
+
### 成员协作
|
|
32
|
+
|
|
33
|
+
是时候邀请成员一起编写卓越的代码工程了,请点击右上角「成员」邀请你的小伙伴开始协作吧!
|
|
34
|
+
|
|
35
|
+
### 更多
|
|
36
|
+
|
|
37
37
|
Git 使用教学、高级功能指引等更多说明,参见[__Codeup帮助文档__](https://thoughts.aliyun.com/sharespace/5e8c37eb546fd9001aee8242/docs/5e8c37e6546fd9001aee81fa)。
|
package/lib/MySQL/connector.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import mysql from 'mysql2';
|
|
2
|
-
import { TxnOption } from 'oak-domain/lib/types';
|
|
3
|
-
import { MySQLConfiguration } from './types/Configuration';
|
|
4
|
-
export declare class MySqlConnector {
|
|
5
|
-
pool?: mysql.Pool;
|
|
6
|
-
configuration: MySQLConfiguration;
|
|
7
|
-
txnDict: Record<string, mysql.PoolConnection>;
|
|
8
|
-
constructor(configuration: MySQLConfiguration);
|
|
9
|
-
connect(): void;
|
|
10
|
-
disconnect(): void;
|
|
11
|
-
startTransaction(option?: TxnOption): Promise<string>;
|
|
12
|
-
exec(sql: string, txn?: string): Promise<any>;
|
|
13
|
-
commitTransaction(txn: string): Promise<void>;
|
|
14
|
-
rollbackTransaction(txn: string): Promise<void>;
|
|
15
|
-
}
|
|
1
|
+
import mysql from 'mysql2';
|
|
2
|
+
import { TxnOption } from 'oak-domain/lib/types';
|
|
3
|
+
import { MySQLConfiguration } from './types/Configuration';
|
|
4
|
+
export declare class MySqlConnector {
|
|
5
|
+
pool?: mysql.Pool;
|
|
6
|
+
configuration: MySQLConfiguration;
|
|
7
|
+
txnDict: Record<string, mysql.PoolConnection>;
|
|
8
|
+
constructor(configuration: MySQLConfiguration);
|
|
9
|
+
connect(): void;
|
|
10
|
+
disconnect(): void;
|
|
11
|
+
startTransaction(option?: TxnOption): Promise<string>;
|
|
12
|
+
exec(sql: string, txn?: string): Promise<any>;
|
|
13
|
+
commitTransaction(txn: string): Promise<void>;
|
|
14
|
+
rollbackTransaction(txn: string): Promise<void>;
|
|
15
|
+
}
|
package/lib/MySQL/connector.js
CHANGED
|
@@ -1,124 +1,124 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MySqlConnector = void 0;
|
|
4
|
-
var tslib_1 = require("tslib");
|
|
5
|
-
var mysql2_1 = tslib_1.__importDefault(require("mysql2"));
|
|
6
|
-
var uuid_1 = require("uuid");
|
|
7
|
-
var assert_1 = tslib_1.__importDefault(require("assert"));
|
|
8
|
-
var MySqlConnector = /** @class */ (function () {
|
|
9
|
-
function MySqlConnector(configuration) {
|
|
10
|
-
this.configuration = configuration;
|
|
11
|
-
this.txnDict = {};
|
|
12
|
-
}
|
|
13
|
-
MySqlConnector.prototype.connect = function () {
|
|
14
|
-
this.pool = mysql2_1.default.createPool(this.configuration);
|
|
15
|
-
};
|
|
16
|
-
MySqlConnector.prototype.disconnect = function () {
|
|
17
|
-
this.pool.end();
|
|
18
|
-
};
|
|
19
|
-
MySqlConnector.prototype.startTransaction = function (option) {
|
|
20
|
-
var _this = this;
|
|
21
|
-
return new Promise(function (resolve, reject) {
|
|
22
|
-
_this.pool.getConnection(function (err, connection) {
|
|
23
|
-
if (err) {
|
|
24
|
-
return reject(err);
|
|
25
|
-
}
|
|
26
|
-
var isolationLevel = (option || {}).isolationLevel;
|
|
27
|
-
var startTxn = function () {
|
|
28
|
-
var sql = 'START TRANSACTION;';
|
|
29
|
-
connection.query(sql, function (err2) {
|
|
30
|
-
var _a;
|
|
31
|
-
if (err2) {
|
|
32
|
-
connection.release();
|
|
33
|
-
return reject(err2);
|
|
34
|
-
}
|
|
35
|
-
var id = (0, uuid_1.v4)();
|
|
36
|
-
Object.assign(_this.txnDict, (_a = {},
|
|
37
|
-
_a[id] = connection,
|
|
38
|
-
_a));
|
|
39
|
-
resolve(id);
|
|
40
|
-
});
|
|
41
|
-
};
|
|
42
|
-
if (isolationLevel) {
|
|
43
|
-
connection.query("SET TRANSACTION ISOLATION LEVEL ".concat(isolationLevel, ";"), function (err2) {
|
|
44
|
-
if (err2) {
|
|
45
|
-
connection.release();
|
|
46
|
-
return reject(err2);
|
|
47
|
-
}
|
|
48
|
-
startTxn();
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
startTxn();
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
});
|
|
56
|
-
};
|
|
57
|
-
MySqlConnector.prototype.exec = function (sql, txn) {
|
|
58
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
59
|
-
var connection_1;
|
|
60
|
-
var _this = this;
|
|
61
|
-
return tslib_1.__generator(this, function (_a) {
|
|
62
|
-
if (process.env.NODE_ENV === 'development') {
|
|
63
|
-
console.log(sql);
|
|
64
|
-
}
|
|
65
|
-
if (txn) {
|
|
66
|
-
connection_1 = this.txnDict[txn];
|
|
67
|
-
(0, assert_1.default)(connection_1);
|
|
68
|
-
return [2 /*return*/, new Promise(function (resolve, reject) {
|
|
69
|
-
connection_1.query(sql, function (err, result) {
|
|
70
|
-
if (err) {
|
|
71
|
-
console.error("sql exec err: ".concat(sql), err);
|
|
72
|
-
return reject(err);
|
|
73
|
-
}
|
|
74
|
-
resolve(result);
|
|
75
|
-
});
|
|
76
|
-
})];
|
|
77
|
-
}
|
|
78
|
-
else {
|
|
79
|
-
return [2 /*return*/, new Promise(function (resolve, reject) {
|
|
80
|
-
// if (process.env.DEBUG) {
|
|
81
|
-
// console.log(sql);
|
|
82
|
-
//}
|
|
83
|
-
_this.pool.query(sql, function (err, result) {
|
|
84
|
-
if (err) {
|
|
85
|
-
console.error("sql exec err: ".concat(sql), err);
|
|
86
|
-
return reject(err);
|
|
87
|
-
}
|
|
88
|
-
resolve(result);
|
|
89
|
-
});
|
|
90
|
-
})];
|
|
91
|
-
}
|
|
92
|
-
return [2 /*return*/];
|
|
93
|
-
});
|
|
94
|
-
});
|
|
95
|
-
};
|
|
96
|
-
MySqlConnector.prototype.commitTransaction = function (txn) {
|
|
97
|
-
var connection = this.txnDict[txn];
|
|
98
|
-
(0, assert_1.default)(connection);
|
|
99
|
-
return new Promise(function (resolve, reject) {
|
|
100
|
-
connection.query('COMMIT;', function (err) {
|
|
101
|
-
if (err) {
|
|
102
|
-
return reject(err);
|
|
103
|
-
}
|
|
104
|
-
connection.release();
|
|
105
|
-
resolve();
|
|
106
|
-
});
|
|
107
|
-
});
|
|
108
|
-
};
|
|
109
|
-
MySqlConnector.prototype.rollbackTransaction = function (txn) {
|
|
110
|
-
var connection = this.txnDict[txn];
|
|
111
|
-
(0, assert_1.default)(connection);
|
|
112
|
-
return new Promise(function (resolve, reject) {
|
|
113
|
-
connection.query('ROLLBACK;', function (err) {
|
|
114
|
-
if (err) {
|
|
115
|
-
return reject(err);
|
|
116
|
-
}
|
|
117
|
-
connection.release();
|
|
118
|
-
resolve();
|
|
119
|
-
});
|
|
120
|
-
});
|
|
121
|
-
};
|
|
122
|
-
return MySqlConnector;
|
|
123
|
-
}());
|
|
124
|
-
exports.MySqlConnector = MySqlConnector;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MySqlConnector = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var mysql2_1 = tslib_1.__importDefault(require("mysql2"));
|
|
6
|
+
var uuid_1 = require("uuid");
|
|
7
|
+
var assert_1 = tslib_1.__importDefault(require("assert"));
|
|
8
|
+
var MySqlConnector = /** @class */ (function () {
|
|
9
|
+
function MySqlConnector(configuration) {
|
|
10
|
+
this.configuration = configuration;
|
|
11
|
+
this.txnDict = {};
|
|
12
|
+
}
|
|
13
|
+
MySqlConnector.prototype.connect = function () {
|
|
14
|
+
this.pool = mysql2_1.default.createPool(this.configuration);
|
|
15
|
+
};
|
|
16
|
+
MySqlConnector.prototype.disconnect = function () {
|
|
17
|
+
this.pool.end();
|
|
18
|
+
};
|
|
19
|
+
MySqlConnector.prototype.startTransaction = function (option) {
|
|
20
|
+
var _this = this;
|
|
21
|
+
return new Promise(function (resolve, reject) {
|
|
22
|
+
_this.pool.getConnection(function (err, connection) {
|
|
23
|
+
if (err) {
|
|
24
|
+
return reject(err);
|
|
25
|
+
}
|
|
26
|
+
var isolationLevel = (option || {}).isolationLevel;
|
|
27
|
+
var startTxn = function () {
|
|
28
|
+
var sql = 'START TRANSACTION;';
|
|
29
|
+
connection.query(sql, function (err2) {
|
|
30
|
+
var _a;
|
|
31
|
+
if (err2) {
|
|
32
|
+
connection.release();
|
|
33
|
+
return reject(err2);
|
|
34
|
+
}
|
|
35
|
+
var id = (0, uuid_1.v4)();
|
|
36
|
+
Object.assign(_this.txnDict, (_a = {},
|
|
37
|
+
_a[id] = connection,
|
|
38
|
+
_a));
|
|
39
|
+
resolve(id);
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
if (isolationLevel) {
|
|
43
|
+
connection.query("SET TRANSACTION ISOLATION LEVEL ".concat(isolationLevel, ";"), function (err2) {
|
|
44
|
+
if (err2) {
|
|
45
|
+
connection.release();
|
|
46
|
+
return reject(err2);
|
|
47
|
+
}
|
|
48
|
+
startTxn();
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
startTxn();
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
MySqlConnector.prototype.exec = function (sql, txn) {
|
|
58
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
59
|
+
var connection_1;
|
|
60
|
+
var _this = this;
|
|
61
|
+
return tslib_1.__generator(this, function (_a) {
|
|
62
|
+
if (process.env.NODE_ENV === 'development') {
|
|
63
|
+
console.log(sql);
|
|
64
|
+
}
|
|
65
|
+
if (txn) {
|
|
66
|
+
connection_1 = this.txnDict[txn];
|
|
67
|
+
(0, assert_1.default)(connection_1);
|
|
68
|
+
return [2 /*return*/, new Promise(function (resolve, reject) {
|
|
69
|
+
connection_1.query(sql, function (err, result) {
|
|
70
|
+
if (err) {
|
|
71
|
+
console.error("sql exec err: ".concat(sql), err);
|
|
72
|
+
return reject(err);
|
|
73
|
+
}
|
|
74
|
+
resolve(result);
|
|
75
|
+
});
|
|
76
|
+
})];
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
return [2 /*return*/, new Promise(function (resolve, reject) {
|
|
80
|
+
// if (process.env.DEBUG) {
|
|
81
|
+
// console.log(sql);
|
|
82
|
+
//}
|
|
83
|
+
_this.pool.query(sql, function (err, result) {
|
|
84
|
+
if (err) {
|
|
85
|
+
console.error("sql exec err: ".concat(sql), err);
|
|
86
|
+
return reject(err);
|
|
87
|
+
}
|
|
88
|
+
resolve(result);
|
|
89
|
+
});
|
|
90
|
+
})];
|
|
91
|
+
}
|
|
92
|
+
return [2 /*return*/];
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
};
|
|
96
|
+
MySqlConnector.prototype.commitTransaction = function (txn) {
|
|
97
|
+
var connection = this.txnDict[txn];
|
|
98
|
+
(0, assert_1.default)(connection);
|
|
99
|
+
return new Promise(function (resolve, reject) {
|
|
100
|
+
connection.query('COMMIT;', function (err) {
|
|
101
|
+
if (err) {
|
|
102
|
+
return reject(err);
|
|
103
|
+
}
|
|
104
|
+
connection.release();
|
|
105
|
+
resolve();
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
};
|
|
109
|
+
MySqlConnector.prototype.rollbackTransaction = function (txn) {
|
|
110
|
+
var connection = this.txnDict[txn];
|
|
111
|
+
(0, assert_1.default)(connection);
|
|
112
|
+
return new Promise(function (resolve, reject) {
|
|
113
|
+
connection.query('ROLLBACK;', function (err) {
|
|
114
|
+
if (err) {
|
|
115
|
+
return reject(err);
|
|
116
|
+
}
|
|
117
|
+
connection.release();
|
|
118
|
+
resolve();
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
};
|
|
122
|
+
return MySqlConnector;
|
|
123
|
+
}());
|
|
124
|
+
exports.MySqlConnector = MySqlConnector;
|
package/lib/MySQL/store.d.ts
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { EntityDict, OperateOption, OperationResult, TxnOption, StorageSchema, SelectOption, AggregationResult } from 'oak-domain/lib/types';
|
|
2
|
-
import { EntityDict as BaseEntityDict } from 'oak-domain/lib/base-app-domain';
|
|
3
|
-
import { CascadeStore } from 'oak-domain/lib/store/CascadeStore';
|
|
4
|
-
import { MySQLConfiguration } from './types/Configuration';
|
|
5
|
-
import { MySqlConnector } from './connector';
|
|
6
|
-
import { MySqlTranslator, MySqlSelectOption, MysqlOperateOption } from './translator';
|
|
7
|
-
import { AsyncContext, AsyncRowStore } from 'oak-domain/lib/store/AsyncRowStore';
|
|
8
|
-
import { SyncContext } from 'oak-domain/lib/store/SyncRowStore';
|
|
9
|
-
export declare class MysqlStore<ED extends EntityDict & BaseEntityDict, Cxt extends AsyncContext<ED>> extends CascadeStore<ED> implements AsyncRowStore<ED, Cxt> {
|
|
10
|
-
protected aggregateSync<T extends keyof ED, OP extends SelectOption, Cxt extends SyncContext<ED>>(entity: T, aggregation: ED[T]['Aggregation'], context: Cxt, option: OP): AggregationResult<ED[T]['Schema']>;
|
|
11
|
-
protected selectAbjointRow<T extends keyof ED, OP extends SelectOption>(entity: T, selection: ED[T]['Selection'], context: SyncContext<ED>, option: OP): Partial<ED[T]['Schema']>[];
|
|
12
|
-
protected updateAbjointRow<T extends keyof ED, OP extends OperateOption>(entity: T, operation: ED[T]['Operation'], context: SyncContext<ED>, option: OP): number;
|
|
13
|
-
connector: MySqlConnector;
|
|
14
|
-
translator: MySqlTranslator<ED>;
|
|
15
|
-
constructor(storageSchema: StorageSchema<ED>, configuration: MySQLConfiguration);
|
|
16
|
-
protected aggregateAsync<T extends keyof ED, OP extends SelectOption, Cxt extends AsyncContext<ED>>(entity: T, aggregation: ED[T]['Aggregation'], context: Cxt, option: OP): Promise<AggregationResult<ED[T]['Schema']>>;
|
|
17
|
-
aggregate<T extends keyof ED, OP extends SelectOption>(entity: T, aggregation: ED[T]['Aggregation'], context: Cxt, option: OP): Promise<AggregationResult<ED[T]['Schema']>>;
|
|
18
|
-
protected supportManyToOneJoin(): boolean;
|
|
19
|
-
protected supportMultipleCreate(): boolean;
|
|
20
|
-
private formResult;
|
|
21
|
-
protected selectAbjointRowAsync<T extends keyof ED>(entity: T, selection: ED[T]['Selection'], context: AsyncContext<ED>, option?: MySqlSelectOption): Promise<Partial<ED[T]['Schema']>[]>;
|
|
22
|
-
protected updateAbjointRowAsync<T extends keyof ED>(entity: T, operation: ED[T]['Operation'], context: AsyncContext<ED>, option?: MysqlOperateOption): Promise<number>;
|
|
23
|
-
operate<T extends keyof ED>(entity: T, operation: ED[T]['Operation'], context: Cxt, option: OperateOption): Promise<OperationResult<ED>>;
|
|
24
|
-
select<T extends keyof ED>(entity: T, selection: ED[T]['Selection'], context: Cxt, option: SelectOption): Promise<Partial<ED[T]['Schema']>[]>;
|
|
25
|
-
count<T extends keyof ED>(entity: T, selection: Pick<ED[T]['Selection'], 'filter' | 'count'>, context: Cxt, option: SelectOption): Promise<number>;
|
|
26
|
-
begin(option?: TxnOption): Promise<string>;
|
|
27
|
-
commit(txnId: string): Promise<void>;
|
|
28
|
-
rollback(txnId: string): Promise<void>;
|
|
29
|
-
connect(): void;
|
|
30
|
-
disconnect(): void;
|
|
31
|
-
initialize(dropIfExists?: boolean): Promise<void>;
|
|
32
|
-
}
|
|
1
|
+
import { EntityDict, OperateOption, OperationResult, TxnOption, StorageSchema, SelectOption, AggregationResult } from 'oak-domain/lib/types';
|
|
2
|
+
import { EntityDict as BaseEntityDict } from 'oak-domain/lib/base-app-domain';
|
|
3
|
+
import { CascadeStore } from 'oak-domain/lib/store/CascadeStore';
|
|
4
|
+
import { MySQLConfiguration } from './types/Configuration';
|
|
5
|
+
import { MySqlConnector } from './connector';
|
|
6
|
+
import { MySqlTranslator, MySqlSelectOption, MysqlOperateOption } from './translator';
|
|
7
|
+
import { AsyncContext, AsyncRowStore } from 'oak-domain/lib/store/AsyncRowStore';
|
|
8
|
+
import { SyncContext } from 'oak-domain/lib/store/SyncRowStore';
|
|
9
|
+
export declare class MysqlStore<ED extends EntityDict & BaseEntityDict, Cxt extends AsyncContext<ED>> extends CascadeStore<ED> implements AsyncRowStore<ED, Cxt> {
|
|
10
|
+
protected aggregateSync<T extends keyof ED, OP extends SelectOption, Cxt extends SyncContext<ED>>(entity: T, aggregation: ED[T]['Aggregation'], context: Cxt, option: OP): AggregationResult<ED[T]['Schema']>;
|
|
11
|
+
protected selectAbjointRow<T extends keyof ED, OP extends SelectOption>(entity: T, selection: ED[T]['Selection'], context: SyncContext<ED>, option: OP): Partial<ED[T]['Schema']>[];
|
|
12
|
+
protected updateAbjointRow<T extends keyof ED, OP extends OperateOption>(entity: T, operation: ED[T]['Operation'], context: SyncContext<ED>, option: OP): number;
|
|
13
|
+
connector: MySqlConnector;
|
|
14
|
+
translator: MySqlTranslator<ED>;
|
|
15
|
+
constructor(storageSchema: StorageSchema<ED>, configuration: MySQLConfiguration);
|
|
16
|
+
protected aggregateAsync<T extends keyof ED, OP extends SelectOption, Cxt extends AsyncContext<ED>>(entity: T, aggregation: ED[T]['Aggregation'], context: Cxt, option: OP): Promise<AggregationResult<ED[T]['Schema']>>;
|
|
17
|
+
aggregate<T extends keyof ED, OP extends SelectOption>(entity: T, aggregation: ED[T]['Aggregation'], context: Cxt, option: OP): Promise<AggregationResult<ED[T]['Schema']>>;
|
|
18
|
+
protected supportManyToOneJoin(): boolean;
|
|
19
|
+
protected supportMultipleCreate(): boolean;
|
|
20
|
+
private formResult;
|
|
21
|
+
protected selectAbjointRowAsync<T extends keyof ED>(entity: T, selection: ED[T]['Selection'], context: AsyncContext<ED>, option?: MySqlSelectOption): Promise<Partial<ED[T]['Schema']>[]>;
|
|
22
|
+
protected updateAbjointRowAsync<T extends keyof ED>(entity: T, operation: ED[T]['Operation'], context: AsyncContext<ED>, option?: MysqlOperateOption): Promise<number>;
|
|
23
|
+
operate<T extends keyof ED>(entity: T, operation: ED[T]['Operation'], context: Cxt, option: OperateOption): Promise<OperationResult<ED>>;
|
|
24
|
+
select<T extends keyof ED>(entity: T, selection: ED[T]['Selection'], context: Cxt, option: SelectOption): Promise<Partial<ED[T]['Schema']>[]>;
|
|
25
|
+
count<T extends keyof ED>(entity: T, selection: Pick<ED[T]['Selection'], 'filter' | 'count'>, context: Cxt, option: SelectOption): Promise<number>;
|
|
26
|
+
begin(option?: TxnOption): Promise<string>;
|
|
27
|
+
commit(txnId: string): Promise<void>;
|
|
28
|
+
rollback(txnId: string): Promise<void>;
|
|
29
|
+
connect(): void;
|
|
30
|
+
disconnect(): void;
|
|
31
|
+
initialize(dropIfExists?: boolean): Promise<void>;
|
|
32
|
+
}
|