@zyno-io/ts-server-foundation 26.1026.1655 → 26.1028.326
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/src/app/base.js +1 -1
- package/dist/src/database/drivers/mysql.d.ts +2 -0
- package/dist/src/database/drivers/mysql.d.ts.map +1 -1
- package/dist/src/database/drivers/mysql.js +98 -13
- package/dist/src/database/drivers/mysql.js.map +1 -1
- package/dist/src/database/query.js +1 -1
- package/package.json +2 -2
package/dist/src/app/base.js
CHANGED
|
@@ -604,7 +604,7 @@ Examples:
|
|
|
604
604
|
}
|
|
605
605
|
this.signalHandlers = undefined;
|
|
606
606
|
}
|
|
607
|
-
static __tsfType = _AppMetadata_1 = _a.decodeCompactMetadataV2("[2,{\"kind\":16,\"name\":\"App\",\"typeName\":\"App\",\"classType\":{\"$tsf\":0},\"properties\":[{\"name\":\"container\",\"type\":{\"$tsfNode\":0},\"optional\":false},{\"name\":\"events\",\"type\":{\"kind\":16,\"typeName\":\"EventBus\",\"classType\":{\"$tsfImport\":[1,\"../events/index\",\"EventBus\"]}},\"optional\":false},{\"name\":\"config\",\"type\":{\"$tsfType\":0},\"optional\":false},{\"name\":\"router\",\"type\":{\"kind\":16,\"typeName\":\"HttpRouter\",\"classType\":{\"$tsfImport\":[1,\"../http/index\",\"HttpRouter\"]}},\"optional\":false},{\"name\":\"http\",\"type\":{\"kind\":16,\"typeName\":\"HttpServerRuntime\",\"classType\":{\"$tsfImport\":[1,\"../http/index\",\"HttpServerRuntime\"]},\"typeArguments\":[{\"kind\":2,\"typeName\":\"C\"}]},\"optional\":false}],\"methods\":[{\"name\":\"get\",\"parameters\":[{\"name\":\"token\",\"type\":{\"$tsfType\":1},\"optional\":false,\"default\":false}],\"returnType\":{\"$tsfType\":2}},{\"name\":\"getInjectorContext\",\"parameters\":[],\"returnType\":{\"$tsfNode\":0}},{\"name\":\"on\",\"parameters\":[{\"name\":\"token\",\"type\":{\"kind\":16,\"typeName\":\"EventToken\",\"classType\":{\"$tsfImport\":[1,\"../events/index\",\"EventToken\"]},\"typeArguments\":[{\"kind\":16,\"typeName\":\"TEvent\",\"classType\":{\"$tsf\":2}}]},\"optional\":false,\"default\":false},{\"name\":\"handler\",\"type\":{\"$tsfType\":3},\"optional\":false,\"default\":false},{\"name\":\"order\",\"type\":{\"$tsfType\":4},\"optional\":true,\"default\":true}],\"returnType\":{\"$tsfType\":5}},{\"name\":\"registerCleanup\",\"parameters\":[{\"name\":\"cleanup\",\"type\":{\"$tsfType\":6},\"optional\":false,\"default\":false}],\"returnType\":{\"$tsfType\":5},\"description\":\"Register cleanup for a resource acquired by this application.\"},{\"name\":\"registerShutdownDrain\",\"parameters\":[{\"name\":\"drain\",\"type\":{\"$tsfType\":6},\"optional\":false,\"default\":false}],\"returnType\":{\"$tsfType\":5},\"description\":\"Register work that must finish before registered application cleanups run.\"},{\"name\":\"start\",\"parameters\":[],\"returnType\":{\"$tsfType\":7}},{\"name\":\"stop\",\"parameters\":[],\"returnType\":{\"$tsfType\":7}},{\"name\":\"run\",\"parameters\":[{\"name\":\"port\",\"type\":{\"$tsfType\":8},\"optional\":true,\"default\":false},{\"name\":\"host\",\"type\":{\"$tsfType\":9},\"optional\":true,\"default\":false}],\"returnType\":{\"$tsfType\":7}},{\"name\":\"configureForCliService\",\"parameters\":[],\"returnType\":{\"$tsfType\":10}},{\"name\":\"configureForRepl\",\"parameters\":[],\"returnType\":{\"$tsfType\":10}},{\"name\":\"request\",\"parameters\":[{\"name\":\"request\",\"type\":{\"kind\":16,\"typeName\":\"HttpRequest\",\"classType\":{\"$tsfImport\":[1,\"../http/index\",\"HttpRequest\"]}},\"optional\":false,\"default\":false},{\"name\":\"response\",\"type\":{\"$tsfNode\":1},\"optional\":true,\"default\":true}],\"returnType\":{\"kind\":22,\"type\":{\"$tsfNode\":1}}}],\"hasConstructor\":true,\"constructorParameters\":[{\"name\":\"options\",\"type\":{\"kind\":18,\"typeName\":\"CreateAppOptions\",\"types\":[{\"$tsfNode\":2},{\"$tsfNode\":3},{\"kind\":20,\"name\":\"imports\",\"type\":{\"kind\":12,\"types\":[{\"kind\":14,\"type\":{\"kind\":12,\"types\":[{\"
|
|
607
|
+
static __tsfType = _AppMetadata_1 = _a.decodeCompactMetadataV2("[2,{\"kind\":16,\"name\":\"App\",\"typeName\":\"App\",\"classType\":{\"$tsf\":0},\"properties\":[{\"name\":\"container\",\"type\":{\"$tsfNode\":0},\"optional\":false},{\"name\":\"events\",\"type\":{\"kind\":16,\"typeName\":\"EventBus\",\"classType\":{\"$tsfImport\":[1,\"../events/index\",\"EventBus\"]}},\"optional\":false},{\"name\":\"config\",\"type\":{\"$tsfType\":0},\"optional\":false},{\"name\":\"router\",\"type\":{\"kind\":16,\"typeName\":\"HttpRouter\",\"classType\":{\"$tsfImport\":[1,\"../http/index\",\"HttpRouter\"]}},\"optional\":false},{\"name\":\"http\",\"type\":{\"kind\":16,\"typeName\":\"HttpServerRuntime\",\"classType\":{\"$tsfImport\":[1,\"../http/index\",\"HttpServerRuntime\"]},\"typeArguments\":[{\"kind\":2,\"typeName\":\"C\"}]},\"optional\":false}],\"methods\":[{\"name\":\"get\",\"parameters\":[{\"name\":\"token\",\"type\":{\"$tsfType\":1},\"optional\":false,\"default\":false}],\"returnType\":{\"$tsfType\":2}},{\"name\":\"getInjectorContext\",\"parameters\":[],\"returnType\":{\"$tsfNode\":0}},{\"name\":\"on\",\"parameters\":[{\"name\":\"token\",\"type\":{\"kind\":16,\"typeName\":\"EventToken\",\"classType\":{\"$tsfImport\":[1,\"../events/index\",\"EventToken\"]},\"typeArguments\":[{\"kind\":16,\"typeName\":\"TEvent\",\"classType\":{\"$tsf\":2}}]},\"optional\":false,\"default\":false},{\"name\":\"handler\",\"type\":{\"$tsfType\":3},\"optional\":false,\"default\":false},{\"name\":\"order\",\"type\":{\"$tsfType\":4},\"optional\":true,\"default\":true}],\"returnType\":{\"$tsfType\":5}},{\"name\":\"registerCleanup\",\"parameters\":[{\"name\":\"cleanup\",\"type\":{\"$tsfType\":6},\"optional\":false,\"default\":false}],\"returnType\":{\"$tsfType\":5},\"description\":\"Register cleanup for a resource acquired by this application.\"},{\"name\":\"registerShutdownDrain\",\"parameters\":[{\"name\":\"drain\",\"type\":{\"$tsfType\":6},\"optional\":false,\"default\":false}],\"returnType\":{\"$tsfType\":5},\"description\":\"Register work that must finish before registered application cleanups run.\"},{\"name\":\"start\",\"parameters\":[],\"returnType\":{\"$tsfType\":7}},{\"name\":\"stop\",\"parameters\":[],\"returnType\":{\"$tsfType\":7}},{\"name\":\"run\",\"parameters\":[{\"name\":\"port\",\"type\":{\"$tsfType\":8},\"optional\":true,\"default\":false},{\"name\":\"host\",\"type\":{\"$tsfType\":9},\"optional\":true,\"default\":false}],\"returnType\":{\"$tsfType\":7}},{\"name\":\"configureForCliService\",\"parameters\":[],\"returnType\":{\"$tsfType\":10}},{\"name\":\"configureForRepl\",\"parameters\":[],\"returnType\":{\"$tsfType\":10}},{\"name\":\"request\",\"parameters\":[{\"name\":\"request\",\"type\":{\"kind\":16,\"typeName\":\"HttpRequest\",\"classType\":{\"$tsfImport\":[1,\"../http/index\",\"HttpRequest\"]}},\"optional\":false,\"default\":false},{\"name\":\"response\",\"type\":{\"$tsfNode\":1},\"optional\":true,\"default\":true}],\"returnType\":{\"kind\":22,\"type\":{\"$tsfNode\":1}}}],\"hasConstructor\":true,\"constructorParameters\":[{\"name\":\"options\",\"type\":{\"kind\":18,\"typeName\":\"CreateAppOptions\",\"types\":[{\"$tsfNode\":2},{\"$tsfNode\":3},{\"kind\":20,\"name\":\"imports\",\"type\":{\"kind\":12,\"types\":[{\"kind\":14,\"type\":{\"kind\":12,\"types\":[{\"$tsfNode\":4},{\"kind\":2,\"typeName\":\"ClassType\"},{\"kind\":18,\"typeName\":\"ModuleInstance\",\"types\":[{\"kind\":20,\"name\":\"definition\",\"type\":{\"$tsfNode\":4},\"optional\":false}]}],\"typeName\":\"ModuleLike\"}},{\"kind\":4}]},\"optional\":true},{\"$tsfNode\":5},{\"$tsfNode\":6},{\"$tsfNode\":7},{\"$tsfNode\":8},{\"$tsfNode\":9},{\"$tsfNode\":2},{\"$tsfNode\":3},{\"kind\":20,\"name\":\"envPassthrough\",\"type\":{\"kind\":12,\"types\":[{\"kind\":14,\"type\":{\"$tsfNode\":10}},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"db\",\"type\":{\"kind\":12,\"types\":[{\"kind\":2,\"typeName\":\"ClassType\"},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"frameworkConfig\",\"type\":{\"$tsfNode\":11},\"optional\":true},{\"kind\":20,\"name\":\"serverConfig\",\"type\":{\"$tsfNode\":11},\"optional\":true},{\"kind\":20,\"name\":\"cors\",\"type\":{\"kind\":12,\"types\":[{\"kind\":2,\"typeName\":\"HttpCorsConfig\",\"typeArguments\":[{\"kind\":2,\"typeName\":\"C\"}]},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"staticFiles\",\"type\":{\"kind\":12,\"types\":[{\"kind\":12,\"types\":[{\"kind\":8},{\"kind\":18,\"typeName\":\"StaticFilesOptions\",\"types\":[{\"kind\":20,\"name\":\"directory\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"index\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"spaFallback\",\"type\":{\"kind\":12,\"types\":[{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":10,\"literal\":false}]},{\"kind\":4}]},\"optional\":true}]}]},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"requestLogging\",\"type\":{\"kind\":12,\"types\":[{\"kind\":18,\"typeName\":\"HttpRequestLoggingOptions\",\"types\":[{\"kind\":20,\"name\":\"excludePaths\",\"type\":{\"kind\":12,\"types\":[{\"kind\":14,\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"$tsfNode\":10}]}},{\"kind\":4}]},\"optional\":true}]},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"httpResolvers\",\"type\":{\"kind\":12,\"types\":[{\"kind\":18,\"typeName\":\"Record\",\"utilityType\":\"Record\",\"typeArguments\":[{\"kind\":6},{\"kind\":2,\"typeName\":\"RouteParameterResolverInput\"}],\"index\":{\"kind\":2,\"typeName\":\"RouteParameterResolverInput\"},\"types\":[],\"typeName\":\"RouteParameterResolverRegistry\"},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"fallbackController\",\"type\":{\"kind\":12,\"types\":[{\"kind\":2,\"typeName\":\"new (...args: any[]) =\\u003e HttpFallbackController\",\"typeName\":\"ClassType\"},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"enableHealthcheck\",\"type\":{\"kind\":12,\"types\":[{\"kind\":8},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"enableWorker\",\"type\":{\"kind\":12,\"types\":[{\"kind\":8},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"enableDkRpc\",\"type\":{\"kind\":12,\"types\":[{\"kind\":8},{\"kind\":4}]},\"optional\":true}]},\"optional\":false,\"default\":false}]},[{\"kind\":16,\"typeName\":\"Container\",\"classType\":{\"$tsfImport\":[1,\"../di/index\",\"Container\"]}},{\"kind\":16,\"typeName\":\"HttpResponse\",\"classType\":{\"$tsfImport\":[1,\"../http/index\",\"HttpResponse\"]}},{\"kind\":20,\"name\":\"config\",\"type\":{\"$tsfNode\":12},\"optional\":true},{\"kind\":20,\"name\":\"defaultConfig\",\"type\":{\"$tsfNode\":13},\"optional\":true},{\"kind\":18,\"typeName\":\"ModuleDefinition\",\"types\":{\"$tsfNode\":14},\"typeParameters\":[\"C\"]},{\"kind\":20,\"name\":\"exports\",\"type\":{\"$tsfNode\":15},\"optional\":true},{\"kind\":20,\"name\":\"providers\",\"type\":{\"$tsfNode\":16},\"optional\":true},{\"kind\":20,\"name\":\"controllers\",\"type\":{\"$tsfNode\":17},\"optional\":true},{\"kind\":20,\"name\":\"listeners\",\"type\":{\"$tsfNode\":17},\"optional\":true},{\"kind\":20,\"name\":\"commands\",\"type\":{\"$tsfNode\":17},\"optional\":true},{\"kind\":16,\"typeName\":\"RegExp\",\"classType\":{\"$tsf\":3}},{\"kind\":12,\"types\":{\"$tsfNode\":18}},{\"kind\":12,\"types\":{\"$tsfNode\":19}},{\"kind\":12,\"types\":{\"$tsfNode\":20}},[{\"$tsfNode\":2},{\"$tsfNode\":3},{\"$tsfNode\":21},{\"$tsfNode\":5},{\"$tsfNode\":6},{\"$tsfNode\":7},{\"$tsfNode\":8},{\"$tsfNode\":9}],{\"kind\":12,\"types\":{\"$tsfNode\":22}},{\"kind\":12,\"types\":{\"$tsfNode\":23}},{\"kind\":12,\"types\":{\"$tsfNode\":24}},[{\"$tsfNode\":25},{\"kind\":4}],[{\"$tsfNode\":26},{\"kind\":4}],[{\"$tsfNode\":27},{\"kind\":4}],{\"kind\":20,\"name\":\"imports\",\"type\":{\"$tsfNode\":28},\"optional\":true},[{\"kind\":14,\"type\":{\"kind\":2,\"typeName\":\"Token\"}},{\"kind\":4}],[{\"kind\":14,\"type\":{\"kind\":2,\"typeName\":\"Provider\"}},{\"kind\":4}],[{\"kind\":14,\"type\":{\"kind\":2,\"typeName\":\"ClassType\"}},{\"kind\":4}],{\"kind\":18,\"typeName\":\"Record\",\"utilityType\":\"Record\",\"typeArguments\":[{\"kind\":6},{\"kind\":2}],\"index\":{\"kind\":2},\"types\":[]},{\"kind\":2,\"typeName\":\"new (...args: any[]) =\\u003e C\",\"typeName\":\"ClassType\"},{\"kind\":18,\"typeName\":\"Partial\",\"utilityType\":\"Partial\",\"typeArguments\":[{\"kind\":2,\"typeName\":\"C\"}],\"utilityKeys\":[],\"types\":[]},{\"kind\":12,\"types\":[{\"kind\":2,\"typeName\":\"ModuleLike[]\"},{\"kind\":4}]}]]", [() => App, require, () => (typeof TEvent !== "undefined" ? TEvent : (typeof exports !== "undefined" ? exports.TEvent : undefined)), () => (typeof RegExp !== "undefined" ? RegExp : (typeof exports !== "undefined" ? exports.RegExp : undefined))], __tsf_metadata_type);
|
|
608
608
|
}
|
|
609
609
|
exports.App = App;
|
|
610
610
|
_AppMetadata_1.classType = App;
|
|
@@ -7,6 +7,7 @@ export interface MySQLPoolLike {
|
|
|
7
7
|
export interface MySQLConnectionLike {
|
|
8
8
|
query<T = unknown>(sql: string, values?: unknown[]): Promise<[T, unknown]>;
|
|
9
9
|
execute<T = unknown>(sql: string, values?: unknown[]): Promise<[T, unknown]>;
|
|
10
|
+
destroy?(): void;
|
|
10
11
|
release(): void | Promise<void>;
|
|
11
12
|
}
|
|
12
13
|
export declare class MySQLDriver implements DatabaseDriver {
|
|
@@ -18,5 +19,6 @@ export declare class MySQLDriver implements DatabaseDriver {
|
|
|
18
19
|
connect(): Promise<void>;
|
|
19
20
|
close(): Promise<void>;
|
|
20
21
|
acquire(): Promise<DriverConnection>;
|
|
22
|
+
private acquireRaw;
|
|
21
23
|
}
|
|
22
24
|
//# sourceMappingURL=mysql.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mysql.d.ts","sourceRoot":"","sources":["../../../../src/database/drivers/mysql.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAGzD,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAA8B,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"mysql.d.ts","sourceRoot":"","sources":["../../../../src/database/drivers/mysql.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAGzD,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAA8B,MAAM,WAAW,CAAC;AAsC9F,MAAM,WAAW,aAAa;IAC1B,aAAa,IAAI,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAC9C,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AAED,MAAM,WAAW,mBAAmB;IAChC,KAAK,CAAC,CAAC,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;IAC3E,OAAO,CAAC,CAAC,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;IAC7E,OAAO,CAAC,IAAI,IAAI,CAAC;IACjB,OAAO,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACnC;AAED,qBAAa,WAAY,YAAW,cAAc;IAC9C,QAAQ,CAAC,OAAO,EAAG,OAAO,CAAU;IACpC,OAAO,CAAC,IAAI,CAAgB;IAC5B,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAa;IAC/C,OAAO,CAAC,OAAO,CAAC,CAAgB;IAEhC,YAAY,YAAY,EAAE,WAAW,GAAG,aAAa,EASpD;IAEK,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAG7B;IAEK,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAK3B;IAEK,OAAO,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAUzC;IAED,OAAO,CAAC,UAAU;CAIrB"}
|
|
@@ -5,7 +5,40 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const _a = tslib_1.__importStar(require("@zyno-io/ts-reflection/type-metadata-runtime"));
|
|
6
6
|
const promise_1 = require("mysql2/promise");
|
|
7
7
|
const mysql_lifecycle_1 = require("./mysql-lifecycle");
|
|
8
|
-
const __tsf_metadata_type = _a.createCompactMetadataRegistryV2("[2,[{\"kind\":10,\"literal\":\"mysql\"},{\"kind\":22,\"type\":{\"kind\":3}},{\"kind\":22,\"type\":{\"kind\":18,\"typeName\":\"DriverConnection\",\"types\":[]}},{\"kind\":18,\"typeName\":\"RenderedSql\",\"types\":[{\"kind\":20,\"name\":\"sql\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"bindings\",\"type\":{\"kind\":14,\"type\":{\"kind\":2}},\"optional\":false}]},{\"kind\":22,\"type\":{\"kind\":18,\"typeName\":\"QueryResult\",\"types\":[{\"kind\":20,\"name\":\"rows\",\"type\":{\"kind\":14,\"type\":{\"kind\":2,\"typeName\":\"T\"}},\"optional\":false},{\"kind\":20,\"name\":\"executeResult\",\"type\":{\"kind\":12,\"types\":[{\"$tsfNode\":0},{\"kind\":4}]},\"optional\":true}]}},{\"kind\":22,\"type\":{\"$tsfNode\":0}},{\"kind\":6},{\"kind\":18,\"typeName\":\"MySQLConnectionLike\",\"types\":[]}],[{\"kind\":18,\"typeName\":\"ExecuteResult\",\"types\":{\"$tsfNode\":1}},[{\"$tsfNode\":2},{\"$tsfNode\":3},{\"$tsfNode\":4},{\"$tsfNode\":5}],{\"kind\":20,\"name\":\"affectedRows\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"insertId\",\"type\":{\"$tsfNode\":6},\"optional\":true},{\"kind\":20,\"name\":\"warningStatus\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"rowCount\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":12,\"types\":[{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":6}]},{\"kind\":4}]}]]", []);
|
|
8
|
+
const __tsf_metadata_type = _a.createCompactMetadataRegistryV2("[2,[{\"kind\":10,\"literal\":\"mysql\"},{\"kind\":22,\"type\":{\"kind\":3}},{\"kind\":22,\"type\":{\"kind\":18,\"typeName\":\"DriverConnection\",\"types\":[]}},{\"kind\":18,\"typeName\":\"RenderedSql\",\"types\":[{\"kind\":20,\"name\":\"sql\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"bindings\",\"type\":{\"kind\":14,\"type\":{\"kind\":2}},\"optional\":false}]},{\"kind\":22,\"type\":{\"kind\":18,\"typeName\":\"QueryResult\",\"types\":[{\"kind\":20,\"name\":\"rows\",\"type\":{\"kind\":14,\"type\":{\"kind\":2,\"typeName\":\"T\"}},\"optional\":false},{\"kind\":20,\"name\":\"executeResult\",\"type\":{\"kind\":12,\"types\":[{\"$tsfNode\":0},{\"kind\":4}]},\"optional\":true}]}},{\"kind\":22,\"type\":{\"$tsfNode\":0}},{\"kind\":6},{\"kind\":12,\"types\":[{\"kind\":18,\"typeName\":\"MySQLConnectionLike\",\"types\":[]},{\"kind\":4}]},{\"kind\":2,\"typeName\":\"() =\\u003e Promise\\u003cMySQLConnectionLike\\u003e\"}],[{\"kind\":18,\"typeName\":\"ExecuteResult\",\"types\":{\"$tsfNode\":1}},[{\"$tsfNode\":2},{\"$tsfNode\":3},{\"$tsfNode\":4},{\"$tsfNode\":5}],{\"kind\":20,\"name\":\"affectedRows\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"insertId\",\"type\":{\"$tsfNode\":6},\"optional\":true},{\"kind\":20,\"name\":\"warningStatus\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"rowCount\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":12,\"types\":[{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":6}]},{\"kind\":4}]}]]", []);
|
|
9
|
+
// A node can accept connections before Galera allows application statements.
|
|
10
|
+
// After an explicit readiness rejection, retry connection errors only while
|
|
11
|
+
// acquiring a replacement: a lost SQL response can leave a write outcome unknown.
|
|
12
|
+
// Cover the operator's two 10-second HAProxy health checks while trying a
|
|
13
|
+
// healthy backend quickly when one is already available.
|
|
14
|
+
const WSREP_RETRY_DELAYS_MS = [100, 200, 300, 400, ...Array(40).fill(500)];
|
|
15
|
+
const WSREP_RETRY_BUDGET_MS = 21_000;
|
|
16
|
+
function isWsrepNotReady(error) {
|
|
17
|
+
if (typeof error !== 'object' || error === null)
|
|
18
|
+
return false;
|
|
19
|
+
const candidate = error;
|
|
20
|
+
return [candidate.sqlMessage, candidate.message].some(message => typeof message === 'string' && /\bwsrep\b.*\b(?:has not yet prepared|not ready)\b.*\b(?:node|application use)\b/i.test(message));
|
|
21
|
+
}
|
|
22
|
+
function isTransientConnectionError(error) {
|
|
23
|
+
if (typeof error !== 'object' || error === null)
|
|
24
|
+
return false;
|
|
25
|
+
const candidate = error;
|
|
26
|
+
return ['ECONNREFUSED', 'ECONNRESET', 'ETIMEDOUT', 'EHOSTUNREACH', 'ENETUNREACH', 'PROTOCOL_CONNECTION_LOST'].includes(String(candidate.code));
|
|
27
|
+
}
|
|
28
|
+
async function retryWsrepNotReady(operation, isRetryable = isWsrepNotReady) {
|
|
29
|
+
const deadline = Date.now() + WSREP_RETRY_BUDGET_MS;
|
|
30
|
+
for (let attempt = 0;; attempt++) {
|
|
31
|
+
try {
|
|
32
|
+
return await operation();
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
const delay = WSREP_RETRY_DELAYS_MS[attempt];
|
|
36
|
+
if (delay === undefined || !isRetryable(error) || Date.now() + delay > deadline)
|
|
37
|
+
throw error;
|
|
38
|
+
await new Promise(resolve => setTimeout(resolve, delay));
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
9
42
|
let _MySQLDriverMetadata_1;
|
|
10
43
|
class MySQLDriver {
|
|
11
44
|
dialect = 'mysql';
|
|
@@ -33,10 +66,18 @@ class MySQLDriver {
|
|
|
33
66
|
await this.closing;
|
|
34
67
|
}
|
|
35
68
|
async acquire() {
|
|
69
|
+
let recovering = false;
|
|
70
|
+
const connection = await retryWsrepNotReady(() => this.acquireRaw(), error => {
|
|
71
|
+
if (isWsrepNotReady(error))
|
|
72
|
+
recovering = true;
|
|
73
|
+
return isWsrepNotReady(error) || (recovering && isTransientConnectionError(error));
|
|
74
|
+
});
|
|
75
|
+
return new MySQLConnection(connection, () => this.acquireRaw());
|
|
76
|
+
}
|
|
77
|
+
acquireRaw() {
|
|
36
78
|
if (this.closing)
|
|
37
79
|
throw new Error('MySQL pool is closed');
|
|
38
|
-
|
|
39
|
-
return new MySQLConnection(connection);
|
|
80
|
+
return this.pool.getConnection();
|
|
40
81
|
}
|
|
41
82
|
static __tsfType = _MySQLDriverMetadata_1 = _a.decodeCompactMetadataV2("[2,{\"kind\":16,\"name\":\"MySQLDriver\",\"typeName\":\"MySQLDriver\",\"classType\":{\"$tsf\":0},\"properties\":[{\"name\":\"dialect\",\"type\":{\"$tsfType\":0},\"optional\":false}],\"methods\":[{\"name\":\"connect\",\"parameters\":[],\"returnType\":{\"$tsfType\":1}},{\"name\":\"close\",\"parameters\":[],\"returnType\":{\"$tsfType\":1}},{\"name\":\"acquire\",\"parameters\":[],\"returnType\":{\"$tsfType\":2}}],\"hasConstructor\":true,\"constructorParameters\":[{\"name\":\"configOrPool\",\"type\":{\"kind\":12,\"types\":[{\"$tsfAlias\":[1,\"mysql2/promise\",\"PoolOptions\",\"PoolOptions\"]},{\"kind\":18,\"typeName\":\"MySQLPoolLike\",\"types\":[]}]},\"optional\":false,\"default\":false}]},[]]", [() => MySQLDriver, require], __tsf_metadata_type);
|
|
42
83
|
}
|
|
@@ -46,15 +87,23 @@ MySQLDriver.__tsfType = _MySQLDriverMetadata_1;
|
|
|
46
87
|
let _MySQLConnectionMetadata_1;
|
|
47
88
|
class MySQLConnection {
|
|
48
89
|
connection;
|
|
49
|
-
|
|
90
|
+
acquire;
|
|
91
|
+
transactional = false;
|
|
92
|
+
// Callers can also change session state or start a transaction through raw
|
|
93
|
+
// SQL. Once a statement succeeds, its state cannot safely be reconstructed.
|
|
94
|
+
statementSucceeded = false;
|
|
95
|
+
constructor(connection, acquire) {
|
|
50
96
|
this.connection = connection;
|
|
97
|
+
this.acquire = acquire;
|
|
51
98
|
}
|
|
52
99
|
async query(query) {
|
|
53
|
-
const [rows] = await this.connection.query(query.sql, query.bindings);
|
|
100
|
+
const [rows] = await this.runStatement(connection => connection.query(query.sql, query.bindings));
|
|
101
|
+
this.statementSucceeded = true;
|
|
54
102
|
return { rows: Array.isArray(rows) ? rows : [] };
|
|
55
103
|
}
|
|
56
104
|
async execute(query) {
|
|
57
|
-
const [result] = await this.connection.execute(query.sql, query.bindings);
|
|
105
|
+
const [result] = await this.runStatement(connection => connection.execute(query.sql, query.bindings));
|
|
106
|
+
this.statementSucceeded = true;
|
|
58
107
|
return {
|
|
59
108
|
affectedRows: Number(result?.affectedRows ?? 0),
|
|
60
109
|
insertId: result?.insertId,
|
|
@@ -63,24 +112,60 @@ class MySQLConnection {
|
|
|
63
112
|
};
|
|
64
113
|
}
|
|
65
114
|
async begin() {
|
|
66
|
-
await this.connection.query('START TRANSACTION');
|
|
115
|
+
await this.runStatement(connection => connection.query('START TRANSACTION'));
|
|
116
|
+
this.transactional = true;
|
|
117
|
+
this.statementSucceeded = true;
|
|
67
118
|
}
|
|
68
119
|
async commit() {
|
|
69
|
-
await this.
|
|
120
|
+
await this.getConnection().query('COMMIT');
|
|
121
|
+
this.transactional = false;
|
|
70
122
|
}
|
|
71
123
|
async rollback() {
|
|
72
|
-
await this.
|
|
124
|
+
await this.getConnection().query('ROLLBACK');
|
|
125
|
+
this.transactional = false;
|
|
73
126
|
}
|
|
74
127
|
async savepoint(name) {
|
|
75
|
-
await this.
|
|
128
|
+
await this.getConnection().query(`SAVEPOINT ${quoteSavepoint(name)}`);
|
|
76
129
|
}
|
|
77
130
|
async rollbackToSavepoint(name) {
|
|
78
|
-
await this.
|
|
131
|
+
await this.getConnection().query(`ROLLBACK TO SAVEPOINT ${quoteSavepoint(name)}`);
|
|
79
132
|
}
|
|
80
133
|
async release() {
|
|
81
|
-
await this.connection
|
|
134
|
+
await this.connection?.release();
|
|
135
|
+
}
|
|
136
|
+
getConnection() {
|
|
137
|
+
if (!this.connection)
|
|
138
|
+
throw new Error('MySQL connection is unavailable');
|
|
139
|
+
return this.connection;
|
|
140
|
+
}
|
|
141
|
+
async runStatement(operation) {
|
|
142
|
+
if (this.transactional || this.statementSucceeded)
|
|
143
|
+
return operation(this.getConnection());
|
|
144
|
+
let retryableAcquireError = false;
|
|
145
|
+
return retryWsrepNotReady(async () => {
|
|
146
|
+
retryableAcquireError = false;
|
|
147
|
+
if (!this.connection) {
|
|
148
|
+
try {
|
|
149
|
+
this.connection = await this.acquire();
|
|
150
|
+
}
|
|
151
|
+
catch (error) {
|
|
152
|
+
retryableAcquireError = isTransientConnectionError(error);
|
|
153
|
+
throw error;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
try {
|
|
157
|
+
return await operation(this.connection);
|
|
158
|
+
}
|
|
159
|
+
catch (error) {
|
|
160
|
+
if (isWsrepNotReady(error) && this.connection.destroy) {
|
|
161
|
+
this.connection.destroy();
|
|
162
|
+
this.connection = undefined;
|
|
163
|
+
}
|
|
164
|
+
throw error;
|
|
165
|
+
}
|
|
166
|
+
}, error => isWsrepNotReady(error) || retryableAcquireError);
|
|
82
167
|
}
|
|
83
|
-
static __tsfType = _MySQLConnectionMetadata_1 = _a.decodeCompactMetadataV2("[2,{\"kind\":16,\"name\":\"MySQLConnection\",\"typeName\":\"MySQLConnection\",\"classType\":{\"$tsf\":0},\"properties\":[],\"methods\":[{\"name\":\"query\",\"parameters\":{\"$tsfNode\":0},\"returnType\":{\"$tsfType\":4}},{\"name\":\"execute\",\"parameters\":{\"$tsfNode\":0},\"returnType\":{\"$tsfType\":5}},{\"name\":\"begin\",\"parameters\":[],\"returnType\":{\"$tsfType\":1}},{\"name\":\"commit\",\"parameters\":[],\"returnType\":{\"$tsfType\":1}},{\"name\":\"rollback\",\"parameters\":[],\"returnType\":{\"$tsfType\":1}},{\"name\":\"savepoint\",\"parameters\":{\"$tsfNode\":1},\"returnType\":{\"$tsfType\":1}},{\"name\":\"rollbackToSavepoint\",\"parameters\":{\"$tsfNode\":1},\"returnType\":{\"$tsfType\":1}},{\"name\":\"release\",\"parameters\":[],\"returnType\":{\"$tsfType\":1}}],\"hasConstructor\":true,\"constructorParameters\":[{\"name\":\"connection\",\"type\":{\"$tsfType\":7},\"optional\":false,\"default\":false}]},[[{\"$tsfNode\":2}],[{\"$tsfNode\":3}],{\"name\":\"query\",\"type\":{\"$tsfType\":3},\"optional\":false,\"default\":false},{\"name\":\"name\",\"type\":{\"$tsfType\":6},\"optional\":false,\"default\":false}]]", [() => MySQLConnection], __tsf_metadata_type);
|
|
168
|
+
static __tsfType = _MySQLConnectionMetadata_1 = _a.decodeCompactMetadataV2("[2,{\"kind\":16,\"name\":\"MySQLConnection\",\"typeName\":\"MySQLConnection\",\"classType\":{\"$tsf\":0},\"properties\":[],\"methods\":[{\"name\":\"query\",\"parameters\":{\"$tsfNode\":0},\"returnType\":{\"$tsfType\":4}},{\"name\":\"execute\",\"parameters\":{\"$tsfNode\":0},\"returnType\":{\"$tsfType\":5}},{\"name\":\"begin\",\"parameters\":[],\"returnType\":{\"$tsfType\":1}},{\"name\":\"commit\",\"parameters\":[],\"returnType\":{\"$tsfType\":1}},{\"name\":\"rollback\",\"parameters\":[],\"returnType\":{\"$tsfType\":1}},{\"name\":\"savepoint\",\"parameters\":{\"$tsfNode\":1},\"returnType\":{\"$tsfType\":1}},{\"name\":\"rollbackToSavepoint\",\"parameters\":{\"$tsfNode\":1},\"returnType\":{\"$tsfType\":1}},{\"name\":\"release\",\"parameters\":[],\"returnType\":{\"$tsfType\":1}}],\"hasConstructor\":true,\"constructorParameters\":[{\"name\":\"connection\",\"type\":{\"$tsfType\":7},\"optional\":false,\"default\":false},{\"name\":\"acquire\",\"type\":{\"$tsfType\":8},\"optional\":false,\"default\":false}]},[[{\"$tsfNode\":2}],[{\"$tsfNode\":3}],{\"name\":\"query\",\"type\":{\"$tsfType\":3},\"optional\":false,\"default\":false},{\"name\":\"name\",\"type\":{\"$tsfType\":6},\"optional\":false,\"default\":false}]]", [() => MySQLConnection], __tsf_metadata_type);
|
|
84
169
|
}
|
|
85
170
|
_MySQLConnectionMetadata_1.classType = MySQLConnection;
|
|
86
171
|
MySQLConnection.__tsfType = _MySQLConnectionMetadata_1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mysql.js","sourceRoot":"","sources":["../../../../src/database/drivers/mysql.ts"],"names":[],"mappings":";;;;;AAAA,4CAAyD;AAIzD,uDAAyD
|
|
1
|
+
{"version":3,"file":"mysql.js","sourceRoot":"","sources":["../../../../src/database/drivers/mysql.ts"],"names":[],"mappings":";;;;;AAAA,4CAAyD;AAIzD,uDAAyD;;AAEzD,6EAA6E;AAC7E,4EAA4E;AAC5E,kFAAkF;AAClF,0EAA0E;AAC1E,yDAAyD;AACzD,MAAM,qBAAqB,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,KAAK,CAAS,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AACnF,MAAM,qBAAqB,GAAG,MAAM,CAAC;AAErC,SAAS,eAAe,CAAC,KAAc;IACnC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IAC9D,MAAM,SAAS,GAAG,KAAoD,CAAC;IACvE,OAAO,CAAC,SAAS,CAAC,UAAU,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC,IAAI,CACjD,OAAO,CAAC,EAAE,CAAC,OAAO,OAAO,KAAK,QAAQ,IAAI,kFAAkF,CAAC,IAAI,CAAC,OAAO,CAAC,CAC7I,CAAC;AACN,CAAC;AAED,SAAS,0BAA0B,CAAC,KAAc;IAC9C,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IAC9D,MAAM,SAAS,GAAG,KAA2B,CAAC;IAC9C,OAAO,CAAC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O,KAAK,EAAE,CAAC;oBACb,qBAAqB,GAAG,0BAA0B,CAAC,KAAK,CAAC,CAAC;oBAC1D,MAAM,KAAK,CAAC;gBAChB,CAAC;YACL,CAAC;YACD,IAAI,CAAC;gBACD,OAAO,MAAM,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;YAC5C,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACb,IAAI,eAAe,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC;oBACpD,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC;oBAC1B,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;gBAChC,CAAC;gBACD,MAAM,KAAK,CAAC;YAChB,CAAC;QACL,CAAC,EACD,KAAK,CAAC,EAAE,CAAC,eAAe,CAAC,KAAK,CAAC,IAAI,qBAAqB,CAC3D,CAAC;IACN,CAAC;;CACJ;;;AAED,SAAS,eAAe,CAAC,KAAkC;IACvD,OAAO,OAAQ,KAAuB,CAAC,aAAa,KAAK,UAAU,IAAI,OAAQ,KAAuB,CAAC,GAAG,KAAK,UAAU,CAAC;AAC9H,CAAC;AAED,SAAS,cAAc,CAAC,IAAY;IAChC,OAAO,KAAK,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC;AAC7C,CAAC"}
|
|
@@ -9,7 +9,7 @@ const sql_1 = require("./sql");
|
|
|
9
9
|
const entity_1 = require("./entity");
|
|
10
10
|
const metadata_1 = require("./metadata");
|
|
11
11
|
const values_1 = require("./values");
|
|
12
|
-
const __tsf_metadata_type = _a.createCompactMetadataRegistryV2("[2,[{\"kind\":18,\"typeName\":\"Record\",\"utilityType\":\"Record\",\"typeArguments\":[{\"kind\":6},{\"$tsfNode\":0}],\"index\":{\"$tsfNode\":0},\"types\":[],\"typeName\":\"FilterRecord\"},{\"kind\":12,\"types\":[{\"kind\":2,\"typeName\":\"keyof T\"},{\"kind\":6}]},{\"
|
|
12
|
+
const __tsf_metadata_type = _a.createCompactMetadataRegistryV2("[2,[{\"kind\":18,\"typeName\":\"Record\",\"utilityType\":\"Record\",\"typeArguments\":[{\"kind\":6},{\"$tsfNode\":0}],\"index\":{\"$tsfNode\":0},\"types\":[],\"typeName\":\"FilterRecord\"},{\"kind\":12,\"types\":[{\"kind\":2,\"typeName\":\"keyof T\"},{\"kind\":6}]},{\"$tsfNode\":0},{\"kind\":14,\"type\":{\"kind\":6}},{\"kind\":6},{\"$tsfNode\":1},{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":18,\"typeName\":\"Record\",\"utilityType\":\"Record\",\"typeArguments\":[{\"kind\":6},{\"$tsfNode\":1}],\"index\":{\"$tsfNode\":1},\"types\":[]}]},{\"kind\":7},{\"kind\":22,\"type\":{\"kind\":14,\"type\":{\"kind\":2,\"typeName\":\"T\"}}},{\"kind\":2,\"typeName\":\"K\"},{\"kind\":22,\"type\":{\"kind\":14,\"type\":{\"kind\":2,\"typeName\":\"T[K]\"}}},{\"kind\":22,\"type\":{\"kind\":12,\"types\":[{\"kind\":2,\"typeName\":\"T[K]\"},{\"kind\":4}]}},{\"kind\":22,\"type\":{\"kind\":2,\"typeName\":\"T[K]\"}},{\"kind\":22,\"type\":{\"kind\":12,\"types\":[{\"kind\":2,\"typeName\":\"T\"},{\"kind\":4}]}},{\"kind\":22,\"type\":{\"kind\":2,\"typeName\":\"T\"}},{\"kind\":22,\"type\":{\"kind\":8}},{\"kind\":22,\"type\":{\"kind\":7}},{\"kind\":18,\"typeName\":\"PatchRecord\\u003cT\\u003e\",\"index\":{\"kind\":1},\"types\":[]},{\"kind\":22,\"type\":{\"kind\":18,\"typeName\":\"QueryMutationResult\",\"types\":[{\"kind\":20,\"name\":\"affectedRows\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"modified\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"primaryKeys\",\"type\":{\"kind\":14,\"type\":{\"kind\":18,\"typeName\":\"Record\",\"utilityType\":\"Record\",\"typeArguments\":[{\"kind\":6},{\"kind\":2}],\"index\":{\"kind\":2},\"types\":[]}},\"optional\":false}]}},{\"kind\":18,\"typeName\":\"SqlQuery\",\"types\":[{\"kind\":20,\"name\":\"kind\",\"type\":{\"kind\":10,\"literal\":\"sql\"},\"optional\":false},{\"kind\":20,\"name\":\"chunks\",\"type\":{\"kind\":14,\"type\":{\"kind\":6}},\"optional\":false},{\"kind\":20,\"name\":\"values\",\"type\":{\"kind\":14,\"type\":{\"kind\":2,\"typeName\":\"SqlValue\"}},\"optional\":false}]},{\"kind\":2,\"typeName\":\"EntityClass\",\"typeArguments\":[{\"kind\":2,\"typeName\":\"T\"}]}],[{\"kind\":12,\"types\":{\"$tsfNode\":2},\"typeName\":\"FilterValue\"},{\"kind\":12,\"types\":{\"$tsfNode\":3},\"typeName\":\"DirectionInput\"},[{\"kind\":2},{\"$tsfNode\":4}],[{\"$tsfNode\":5},{\"kind\":10,\"literal\":\"ASC\"},{\"kind\":10,\"literal\":\"DESC\"},{\"kind\":10,\"literal\":1},{\"kind\":10,\"literal\":-1}],{\"kind\":18,\"types\":{\"$tsfNode\":6}},{\"kind\":12,\"types\":[{\"kind\":10,\"literal\":\"asc\"},{\"kind\":10,\"literal\":\"desc\"}],\"typeName\":\"Direction\"},[{\"$tsfNode\":7},{\"$tsfNode\":8},{\"$tsfNode\":9},{\"$tsfNode\":10},{\"$tsfNode\":11},{\"$tsfNode\":12},{\"$tsfNode\":13},{\"$tsfNode\":14},{\"$tsfNode\":15}],{\"kind\":20,\"name\":\"$in\",\"type\":{\"$tsfNode\":16},\"optional\":true},{\"kind\":20,\"name\":\"$nin\",\"type\":{\"$tsfNode\":16},\"optional\":true},{\"kind\":20,\"name\":\"$ne\",\"type\":{\"kind\":12,\"types\":[{\"kind\":2},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"$gt\",\"type\":{\"kind\":12,\"types\":[{\"kind\":2},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"$gte\",\"type\":{\"kind\":12,\"types\":[{\"kind\":2},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"$lt\",\"type\":{\"kind\":12,\"types\":[{\"kind\":2},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"$lte\",\"type\":{\"kind\":12,\"types\":[{\"kind\":2},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"$like\",\"type\":{\"kind\":12,\"types\":[{\"kind\":2},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"$notLike\",\"type\":{\"kind\":12,\"types\":[{\"kind\":2},{\"kind\":4}]},\"optional\":true},{\"kind\":12,\"types\":[{\"kind\":14,\"type\":{\"kind\":2}},{\"kind\":4}]}]]", []);
|
|
13
13
|
const MYSQL_OFFSET_ONLY_LIMIT = '18446744073709551615';
|
|
14
14
|
let _QueryBuilderMetadata_1;
|
|
15
15
|
class QueryBuilder {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zyno-io/ts-server-foundation",
|
|
3
|
-
"version": "26.
|
|
3
|
+
"version": "26.1028.326",
|
|
4
4
|
"description": "TypeScript server foundation with reflected type metadata",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
"@ttsc/graph": "^0.30.1",
|
|
97
97
|
"@types/ws": "^8.18.1",
|
|
98
98
|
"@zyno-io/config": "^1.14.0",
|
|
99
|
-
"@zyno-io/ts-reflection": "26.
|
|
99
|
+
"@zyno-io/ts-reflection": "26.1028.326",
|
|
100
100
|
"bcrypt": "^6.0.0",
|
|
101
101
|
"bullmq": "^6.3.4",
|
|
102
102
|
"busboy": "^1.6.0",
|