@tachybase/module-multi-app 1.5.1 → 1.6.1
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/externalVersion.js +5 -5
- package/dist/node_modules/mariadb/callback.js +43 -8
- package/dist/node_modules/mariadb/check-node.js +30 -0
- package/dist/node_modules/mariadb/lib/cluster-callback.js +84 -0
- package/dist/node_modules/mariadb/lib/cluster.js +446 -0
- package/dist/node_modules/mariadb/lib/cmd/batch-bulk.js +576 -177
- package/dist/node_modules/mariadb/lib/cmd/change-user.js +54 -44
- package/dist/node_modules/mariadb/lib/cmd/class/ok-packet.js +3 -2
- package/dist/node_modules/mariadb/lib/cmd/class/prepare-cache-wrapper.js +46 -0
- package/dist/node_modules/mariadb/lib/cmd/class/prepare-result-packet.js +141 -0
- package/dist/node_modules/mariadb/lib/cmd/class/prepare-wrapper.js +70 -0
- package/dist/node_modules/mariadb/lib/cmd/close-prepare.js +38 -0
- package/dist/node_modules/mariadb/lib/cmd/column-definition.js +145 -47
- package/dist/node_modules/mariadb/lib/cmd/command.js +41 -75
- package/dist/node_modules/mariadb/lib/cmd/decoder/binary-decoder.js +282 -0
- package/dist/node_modules/mariadb/lib/cmd/decoder/text-decoder.js +210 -0
- package/dist/node_modules/mariadb/lib/cmd/{common-binary-cmd.js → encoder/binary-encoder.js} +34 -77
- package/dist/node_modules/mariadb/lib/cmd/encoder/text-encoder.js +311 -0
- package/dist/node_modules/mariadb/lib/cmd/execute-stream.js +61 -0
- package/dist/node_modules/mariadb/lib/cmd/execute.js +338 -0
- package/dist/node_modules/mariadb/lib/cmd/handshake/auth/caching-sha2-password-auth.js +25 -62
- package/dist/node_modules/mariadb/lib/cmd/handshake/auth/clear-password-auth.js +39 -6
- package/dist/node_modules/mariadb/lib/cmd/handshake/auth/ed25519-password-auth.js +48 -16
- package/dist/node_modules/mariadb/lib/cmd/handshake/auth/handshake.js +198 -0
- package/dist/node_modules/mariadb/lib/cmd/handshake/{initial-handshake.js → auth/initial-handshake.js} +10 -8
- package/dist/node_modules/mariadb/lib/cmd/handshake/auth/native-password-auth.js +22 -9
- package/dist/node_modules/mariadb/lib/cmd/handshake/auth/pam-password-auth.js +9 -4
- package/dist/node_modules/mariadb/lib/cmd/handshake/auth/parsec-auth.js +115 -0
- package/dist/node_modules/mariadb/lib/cmd/handshake/auth/plugin-auth.js +12 -5
- package/dist/node_modules/mariadb/lib/cmd/handshake/auth/sha256-password-auth.js +44 -33
- package/dist/node_modules/mariadb/lib/cmd/handshake/authentication.js +335 -0
- package/dist/node_modules/mariadb/lib/cmd/handshake/client-capabilities.js +20 -19
- package/dist/node_modules/mariadb/lib/cmd/handshake/ssl-request.js +6 -3
- package/dist/node_modules/mariadb/lib/cmd/parser.js +861 -0
- package/dist/node_modules/mariadb/lib/cmd/ping.js +17 -18
- package/dist/node_modules/mariadb/lib/cmd/prepare.js +170 -0
- package/dist/node_modules/mariadb/lib/cmd/query.js +281 -144
- package/dist/node_modules/mariadb/lib/cmd/quit.js +9 -6
- package/dist/node_modules/mariadb/lib/cmd/reset.js +15 -19
- package/dist/node_modules/mariadb/lib/cmd/stream.js +21 -6
- package/dist/node_modules/mariadb/lib/config/cluster-options.js +23 -0
- package/dist/node_modules/mariadb/lib/config/connection-options.js +196 -132
- package/dist/node_modules/mariadb/lib/config/pool-options.js +27 -19
- package/dist/node_modules/mariadb/lib/connection-callback.js +492 -120
- package/dist/node_modules/mariadb/lib/connection-promise.js +372 -0
- package/dist/node_modules/mariadb/lib/connection.js +1739 -1016
- package/dist/node_modules/mariadb/lib/const/capabilities.js +36 -30
- package/dist/node_modules/mariadb/lib/const/collations.js +972 -36
- package/dist/node_modules/mariadb/lib/const/connection_status.js +3 -0
- package/dist/node_modules/mariadb/lib/const/error-code.js +35 -11
- package/dist/node_modules/mariadb/lib/const/field-detail.js +3 -0
- package/dist/node_modules/mariadb/lib/const/field-type.js +7 -4
- package/dist/node_modules/mariadb/lib/const/server-status.js +4 -1
- package/dist/node_modules/mariadb/lib/const/state-change.js +3 -0
- package/dist/node_modules/mariadb/lib/filtered-cluster-callback.js +136 -0
- package/dist/node_modules/mariadb/lib/filtered-cluster.js +118 -0
- package/dist/node_modules/mariadb/lib/io/compression-input-stream.js +14 -13
- package/dist/node_modules/mariadb/lib/io/compression-output-stream.js +21 -18
- package/dist/node_modules/mariadb/lib/io/packet-input-stream.js +75 -64
- package/dist/node_modules/mariadb/lib/io/packet-node-encoded.js +13 -9
- package/dist/node_modules/mariadb/lib/io/packet-node-iconv.js +12 -10
- package/dist/node_modules/mariadb/lib/io/packet-output-stream.js +402 -134
- package/dist/node_modules/mariadb/lib/io/packet.js +287 -202
- package/dist/node_modules/mariadb/lib/lru-prepare-cache.js +84 -0
- package/dist/node_modules/mariadb/lib/misc/connection-information.js +15 -32
- package/dist/node_modules/mariadb/lib/misc/errors.js +68 -25
- package/dist/node_modules/mariadb/lib/misc/parse.js +207 -711
- package/dist/node_modules/mariadb/lib/misc/utils.js +34 -62
- package/dist/node_modules/mariadb/lib/pool-callback.js +213 -174
- package/dist/node_modules/mariadb/lib/pool-promise.js +228 -94
- package/dist/node_modules/mariadb/lib/pool.js +951 -0
- package/dist/node_modules/mariadb/package.json +1 -1
- package/dist/node_modules/mariadb/promise.js +1 -34
- package/dist/node_modules/mariadb/types/callback.d.ts +207 -0
- package/dist/node_modules/mariadb/types/index.d.ts +94 -674
- package/dist/node_modules/mariadb/types/share.d.ts +804 -0
- package/dist/node_modules/qs/package.json +1 -1
- package/dist/server/actions/apps.js +2 -2
- package/dist/server/app-lifecycle.d.ts +1 -1
- package/dist/server/app-lifecycle.js +4 -4
- package/dist/server/models/application.d.ts +1 -1
- package/package.json +7 -7
- package/dist/node_modules/mariadb/lib/cmd/batch-rewrite.js +0 -372
- package/dist/node_modules/mariadb/lib/cmd/common-text-cmd.js +0 -427
- package/dist/node_modules/mariadb/lib/cmd/handshake/client-handshake-response.js +0 -126
- package/dist/node_modules/mariadb/lib/cmd/handshake/handshake.js +0 -292
- package/dist/node_modules/mariadb/lib/cmd/resultset.js +0 -607
- package/dist/node_modules/mariadb/lib/config/pool-cluster-options.js +0 -19
- package/dist/node_modules/mariadb/lib/filtered-pool-cluster.js +0 -81
- package/dist/node_modules/mariadb/lib/io/bulk-packet.js +0 -590
- package/dist/node_modules/mariadb/lib/io/rewrite-packet.js +0 -481
- package/dist/node_modules/mariadb/lib/pool-base.js +0 -611
- package/dist/node_modules/mariadb/lib/pool-cluster-callback.js +0 -66
- package/dist/node_modules/mariadb/lib/pool-cluster.js +0 -407
|
@@ -1,108 +1,242 @@
|
|
|
1
|
+
// SPDX-License-Identifier: LGPL-2.1-or-later
|
|
2
|
+
// Copyright (c) 2015-2025 MariaDB Corporation Ab
|
|
3
|
+
|
|
1
4
|
'use strict';
|
|
2
5
|
|
|
3
|
-
const
|
|
4
|
-
|
|
6
|
+
const { EventEmitter } = require('events');
|
|
7
|
+
|
|
8
|
+
const Pool = require('./pool');
|
|
9
|
+
const ConnectionPromise = require('./connection-promise');
|
|
5
10
|
const Errors = require('./misc/errors');
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
11
|
+
|
|
12
|
+
class PoolPromise extends EventEmitter {
|
|
13
|
+
#pool;
|
|
14
|
+
constructor(options) {
|
|
15
|
+
super();
|
|
16
|
+
this.#pool = new Pool(options);
|
|
17
|
+
this.#pool.on('acquire', this.emit.bind(this, 'acquire'));
|
|
18
|
+
this.#pool.on('connection', this.emit.bind(this, 'connection'));
|
|
19
|
+
this.#pool.on('enqueue', this.emit.bind(this, 'enqueue'));
|
|
20
|
+
this.#pool.on('release', this.emit.bind(this, 'release'));
|
|
21
|
+
this.#pool.on('error', this.emit.bind(this, 'error'));
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
get closed() {
|
|
25
|
+
return this.#pool.closed;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Get current total connection number.
|
|
30
|
+
* @return {number}
|
|
31
|
+
*/
|
|
32
|
+
totalConnections() {
|
|
33
|
+
return this.#pool.totalConnections();
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Get current active connections.
|
|
38
|
+
* @return {number}
|
|
39
|
+
*/
|
|
40
|
+
activeConnections() {
|
|
41
|
+
return this.#pool.activeConnections();
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Get current idle connection number.
|
|
46
|
+
* @return {number}
|
|
47
|
+
*/
|
|
48
|
+
idleConnections() {
|
|
49
|
+
return this.#pool.idleConnections();
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Get current stacked connection request.
|
|
54
|
+
* @return {number}
|
|
55
|
+
*/
|
|
56
|
+
taskQueueSize() {
|
|
57
|
+
return this.#pool.taskQueueSize();
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
escape(value) {
|
|
61
|
+
return this.#pool.escape(value);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
escapeId(value) {
|
|
65
|
+
return this.#pool.escapeId(value);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Ends pool
|
|
70
|
+
*
|
|
71
|
+
* @return Promise
|
|
72
|
+
**/
|
|
73
|
+
end() {
|
|
74
|
+
return this.#pool.end();
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Retrieve a connection from pool.
|
|
79
|
+
* Create a new one, if limit is not reached.
|
|
80
|
+
* wait until acquireTimeout.
|
|
81
|
+
*
|
|
82
|
+
*/
|
|
83
|
+
async getConnection() {
|
|
84
|
+
const cmdParam = {};
|
|
85
|
+
if (this.#pool.opts.connOptions.trace) Error.captureStackTrace(cmdParam);
|
|
86
|
+
return new Promise((resolve, reject) => {
|
|
87
|
+
this.#pool.getConnection(cmdParam, (err, baseConn) => {
|
|
88
|
+
if (err) {
|
|
89
|
+
reject(err);
|
|
90
|
+
} else {
|
|
91
|
+
const conn = new ConnectionPromise(baseConn);
|
|
92
|
+
conn.release = () => new Promise(baseConn.release);
|
|
93
|
+
conn.end = conn.release;
|
|
94
|
+
conn.close = conn.release;
|
|
95
|
+
resolve(conn);
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
}
|
|
24
100
|
|
|
25
101
|
/**
|
|
26
|
-
*
|
|
102
|
+
* Execute query using text protocol with callback emit columns/data/end/error
|
|
103
|
+
* events to permit streaming big result-set
|
|
104
|
+
*
|
|
105
|
+
* @param sql sql parameter Object can be used to supersede default option.
|
|
106
|
+
* Object must then have sql property.
|
|
107
|
+
* @param values object / array of placeholder values (not mandatory)
|
|
27
108
|
*/
|
|
28
|
-
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
.
|
|
33
|
-
if (
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
null
|
|
47
|
-
)
|
|
109
|
+
query(sql, values) {
|
|
110
|
+
const cmdParam = ConnectionPromise.paramSetter(sql, values);
|
|
111
|
+
if (this.#pool.opts.connOptions.trace) Error.captureStackTrace(cmdParam);
|
|
112
|
+
return new Promise((resolve, reject) => {
|
|
113
|
+
return this.#pool.getConnection(cmdParam, (err, baseConn) => {
|
|
114
|
+
if (err) {
|
|
115
|
+
reject(err);
|
|
116
|
+
} else {
|
|
117
|
+
baseConn.query(
|
|
118
|
+
cmdParam,
|
|
119
|
+
(res) => {
|
|
120
|
+
this.#pool.release(baseConn);
|
|
121
|
+
resolve(res);
|
|
122
|
+
},
|
|
123
|
+
(err) => {
|
|
124
|
+
this.#pool.release(baseConn);
|
|
125
|
+
reject(err);
|
|
126
|
+
}
|
|
48
127
|
);
|
|
49
128
|
}
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
}
|
|
50
132
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
)
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
return revertFunction()
|
|
82
|
-
.then(() => {
|
|
83
|
-
pool._releaseConnection(conn);
|
|
84
|
-
return Promise.resolve();
|
|
85
|
-
})
|
|
86
|
-
.catch((err) => {
|
|
87
|
-
//uncertain connection state.
|
|
88
|
-
// discard it
|
|
89
|
-
pool._discardConnection(conn);
|
|
90
|
-
return Promise.resolve();
|
|
91
|
-
});
|
|
92
|
-
};
|
|
93
|
-
conn.end = conn.release;
|
|
94
|
-
return Promise.resolve(conn);
|
|
95
|
-
})
|
|
96
|
-
.catch((err) => {
|
|
97
|
-
return Promise.reject(err);
|
|
133
|
+
/**
|
|
134
|
+
* Execute query using binary protocol with callback emit columns/data/end/error
|
|
135
|
+
* events to permit streaming big result-set
|
|
136
|
+
*
|
|
137
|
+
* @param sql sql parameter Object can be used to supersede default option.
|
|
138
|
+
* Object must then have sql property.
|
|
139
|
+
* @param values object / array of placeholder values (not mandatory)
|
|
140
|
+
*/
|
|
141
|
+
execute(sql, values) {
|
|
142
|
+
const cmdParam = ConnectionPromise.paramSetter(sql, values);
|
|
143
|
+
if (this.#pool.opts.connOptions.trace) Error.captureStackTrace(cmdParam);
|
|
144
|
+
return new Promise((resolve, reject) => {
|
|
145
|
+
return this.#pool.getConnection(cmdParam, (err, baseConn) => {
|
|
146
|
+
if (err) {
|
|
147
|
+
reject(err);
|
|
148
|
+
} else {
|
|
149
|
+
baseConn.prepareExecute(
|
|
150
|
+
cmdParam,
|
|
151
|
+
(res) => {
|
|
152
|
+
this.#pool.release(baseConn);
|
|
153
|
+
resolve(res);
|
|
154
|
+
},
|
|
155
|
+
(err) => {
|
|
156
|
+
this.#pool.release(baseConn);
|
|
157
|
+
reject(err);
|
|
158
|
+
}
|
|
159
|
+
);
|
|
160
|
+
}
|
|
98
161
|
});
|
|
99
|
-
|
|
162
|
+
});
|
|
163
|
+
}
|
|
100
164
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
165
|
+
/**
|
|
166
|
+
* execute a batch
|
|
167
|
+
*
|
|
168
|
+
* @param sql sql parameter Object can be used to supersede default option.
|
|
169
|
+
* Object must then have sql property.
|
|
170
|
+
* @param values array of placeholder values
|
|
171
|
+
*/
|
|
172
|
+
batch(sql, values) {
|
|
173
|
+
const cmdParam = ConnectionPromise.paramSetter(sql, values);
|
|
174
|
+
if (this.#pool.opts.connOptions.trace) Error.captureStackTrace(cmdParam);
|
|
175
|
+
return new Promise((resolve, reject) => {
|
|
176
|
+
return this.#pool.getConnection(cmdParam, (err, baseConn) => {
|
|
177
|
+
if (err) {
|
|
178
|
+
reject(err);
|
|
179
|
+
} else {
|
|
180
|
+
baseConn.batch(
|
|
181
|
+
cmdParam,
|
|
182
|
+
(res) => {
|
|
183
|
+
this.#pool.release(baseConn);
|
|
184
|
+
resolve(res);
|
|
185
|
+
},
|
|
186
|
+
(err) => {
|
|
187
|
+
this.#pool.release(baseConn);
|
|
188
|
+
reject(err);
|
|
189
|
+
}
|
|
190
|
+
);
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Import sql file.
|
|
198
|
+
*
|
|
199
|
+
* @param opts JSON array with 2 possible fields: file and database
|
|
200
|
+
*/
|
|
201
|
+
importFile(opts) {
|
|
202
|
+
if (!opts) {
|
|
203
|
+
return Promise.reject(
|
|
204
|
+
Errors.createError(
|
|
205
|
+
'SQL file parameter is mandatory',
|
|
206
|
+
Errors.ER_MISSING_SQL_PARAMETER,
|
|
207
|
+
null,
|
|
208
|
+
'HY000',
|
|
209
|
+
null,
|
|
210
|
+
false,
|
|
211
|
+
null
|
|
212
|
+
)
|
|
213
|
+
);
|
|
214
|
+
}
|
|
105
215
|
|
|
106
|
-
|
|
216
|
+
return new Promise((resolve, reject) => {
|
|
217
|
+
return this.#pool.getConnection({}, (err, baseConn) => {
|
|
218
|
+
if (err) {
|
|
219
|
+
reject(err);
|
|
220
|
+
} else {
|
|
221
|
+
baseConn.importFile(
|
|
222
|
+
{ file: opts.file, database: opts.database },
|
|
223
|
+
(res) => {
|
|
224
|
+
this.#pool.release(baseConn);
|
|
225
|
+
resolve(res);
|
|
226
|
+
},
|
|
227
|
+
(err) => {
|
|
228
|
+
this.#pool.release(baseConn);
|
|
229
|
+
reject(err);
|
|
230
|
+
}
|
|
231
|
+
);
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
toString() {
|
|
238
|
+
return 'poolPromise(' + this.#pool.toString() + ')';
|
|
239
|
+
}
|
|
240
|
+
}
|
|
107
241
|
|
|
108
242
|
module.exports = PoolPromise;
|