@prisma/migrate 6.6.0-dev.8 → 6.6.0-dev.81
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/CLI.js +3 -3
- package/dist/Migrate.js +8 -6
- package/dist/SchemaEngine.js +5 -5
- package/dist/bin.js +47 -46
- package/dist/chunk-23DZXSTI.js +62 -0
- package/dist/{chunk-WWAWV7DQ.js → chunk-2ESYSVXG.js} +3 -27
- package/dist/{chunk-LKTTJWFT.js → chunk-2R6DII47.js} +5 -5
- package/dist/chunk-33LPBNDX.js +1399 -0
- package/dist/{chunk-V3ZMNXZC.js → chunk-5LKIRKDL.js} +307 -382
- package/dist/{chunk-IR55GBON.js → chunk-5LTDMS3H.js} +18 -18
- package/dist/{chunk-LOGAFLCN.js → chunk-5R44VVVX.js} +29 -29
- package/dist/{chunk-Q3ZLC44N.js → chunk-63X7FE2R.js} +57 -66
- package/dist/{chunk-DJMFXNR4.js → chunk-74LUB4XX.js} +56 -57
- package/dist/{chunk-N4XTKFY6.js → chunk-7RM467G7.js} +39 -38
- package/dist/{chunk-RP2N6UXA.js → chunk-AI6DH66U.js} +6 -6
- package/dist/{chunk-A6PMXMMT.js → chunk-AUGZZ6RT.js} +105 -13
- package/dist/{chunk-G2XUUMKH.js → chunk-B4SUSDC2.js} +31 -39
- package/dist/{chunk-ZOEKRXDP.js → chunk-D2DGSPW6.js} +29 -55
- package/dist/{chunk-W2SZNLK4.js → chunk-EJG7GKM7.js} +37 -39
- package/dist/{chunk-5PSO7BDO.js → chunk-EJUXYFV3.js} +15 -15
- package/dist/{chunk-HCBZB4XC.js → chunk-FFPSJTA6.js} +53 -52
- package/dist/{chunk-N3KYWSX2.js → chunk-FZGPSDP7.js} +55 -49
- package/dist/{chunk-MCWCB2AX.js → chunk-IINN7QUV.js} +170 -643
- package/dist/{chunk-KC5MOJ5I.js → chunk-IULCRZZO.js} +371 -530
- package/dist/{chunk-255BRND3.js → chunk-KRQEFTDT.js} +6 -6
- package/dist/{chunk-VVKOFN3Y.js → chunk-LLO7YF56.js} +44 -46
- package/dist/{chunk-VZ23KD5C.js → chunk-NGQA5JTN.js} +8 -10
- package/dist/{chunk-MKK3GSDF.js → chunk-NIKXBMZL.js} +5 -5
- package/dist/{chunk-GG54LOYV.js → chunk-O6RQXRWU.js} +45 -44
- package/dist/{chunk-MATFO4ZW.js → chunk-OEWQACEH.js} +38 -39
- package/dist/{chunk-3GHGKOL4.js → chunk-OPKM35BD.js} +370 -529
- package/dist/{chunk-EGPJABTW.js → chunk-QVMYNWAN.js} +257 -103
- package/dist/{chunk-V5TUSOJX.js → chunk-SQKGZVG3.js} +45 -45
- package/dist/{chunk-CQZFVAXC.js → chunk-TN7JMNXD.js} +42 -41
- package/dist/chunk-URKH6SE2.js +479 -0
- package/dist/chunk-V6PVGSDJ.js +76 -0
- package/dist/{chunk-DLLXDCI2.js → chunk-VAJ4VX67.js} +5 -6
- package/dist/{chunk-OCQGHQED.js → chunk-YBX7R3MT.js} +12 -12
- package/dist/{chunk-KS7IEA6Z.js → chunk-YGBJA7QJ.js} +50 -52
- package/dist/{chunk-WI2A2TQE.js → chunk-ZJ4IDCRR.js} +90 -91
- package/dist/chunk-ZLHWX5PJ.js +883 -0
- package/dist/commands/DbCommand.js +3 -3
- package/dist/commands/DbDrop.js +4 -5
- package/dist/commands/DbExecute.js +9 -7
- package/dist/commands/DbPull.js +11 -10
- package/dist/commands/DbPush.js +10 -9
- package/dist/commands/DbSeed.js +4 -5
- package/dist/commands/MigrateCommand.js +3 -3
- package/dist/commands/MigrateDeploy.js +12 -11
- package/dist/commands/MigrateDev.js +14 -13
- package/dist/commands/MigrateDiff.js +12 -10
- package/dist/commands/MigrateReset.js +13 -12
- package/dist/commands/MigrateResolve.js +10 -9
- package/dist/commands/MigrateStatus.js +10 -9
- package/dist/index.js +50 -51
- package/dist/internals/src/Generator.d.ts +23 -5
- package/dist/internals/src/cli/checkUnsupportedDataProxy.d.ts +12 -17
- package/dist/internals/src/cli/directoryConfig.d.ts +7 -0
- package/dist/internals/src/cli/getSchema.d.ts +3 -28
- package/dist/internals/src/cli/hashes.d.ts +1 -2
- package/dist/internals/src/cli/schemaContext.d.ts +59 -0
- package/dist/internals/src/client/getClientEngineType.d.ts +1 -1
- package/dist/internals/src/convertCredentials.d.ts +1 -1
- package/dist/internals/src/engine-commands/getConfig.d.ts +1 -5
- package/dist/internals/src/engine-commands/getDmmf.d.ts +3 -6
- package/dist/internals/src/engine-commands/lintSchema.d.ts +1 -1
- package/dist/internals/src/errorReporting.d.ts +0 -1
- package/dist/internals/src/get-generators/getGenerators.d.ts +22 -9
- package/dist/internals/src/get-generators/utils/binaryTypeToEngineType.d.ts +1 -1
- package/dist/internals/src/get-generators/utils/engineTypeToBinaryType.d.ts +1 -1
- package/dist/internals/src/get-generators/utils/fixBinaryTargets.d.ts +1 -1
- package/dist/internals/src/get-generators/utils/getBinaryPathsByVersion.d.ts +1 -1
- package/dist/internals/src/get-generators/utils/getEngineVersionForGenerator.d.ts +1 -1
- package/dist/internals/src/get-generators/utils/printGeneratorConfig.d.ts +1 -1
- package/dist/internals/src/index.d.ts +7 -7
- package/dist/internals/src/migrateTypes.d.ts +63 -0
- package/dist/internals/src/panic.d.ts +1 -4
- package/dist/internals/src/resolvePkg.d.ts +7 -0
- package/dist/internals/src/types.d.ts +1 -1
- package/dist/internals/src/utils/extractPreviewFeatures.d.ts +2 -2
- package/dist/internals/src/utils/getEnvPaths.d.ts +1 -1
- package/dist/internals/src/utils/parseEnvValue.d.ts +1 -1
- package/dist/internals/src/utils/schemaFileInput.d.ts +0 -4
- package/dist/internals/src/utils/toSchemasContainer.d.ts +2 -3
- package/dist/migrate/src/Migrate.d.ts +7 -5
- package/dist/migrate/src/SchemaEngine.d.ts +5 -9
- package/dist/migrate/src/index.d.ts +0 -1
- package/dist/migrate/src/types.d.ts +14 -10
- package/dist/migrate/src/utils/createMigration.d.ts +21 -0
- package/dist/migrate/src/utils/ensureDatabaseExists.d.ts +4 -6
- package/dist/migrate/src/utils/introspectSql.d.ts +3 -2
- package/dist/migrate/src/utils/listMigrations.d.ts +9 -0
- package/dist/migrate/src/utils/printDatasources.d.ts +1 -1
- package/dist/migrate/src/utils/seed.d.ts +0 -2
- package/dist/migrate/src/views/handleViewsIO.d.ts +2 -2
- package/dist/{multipart-parser-54WEFGGN-NLZG56KM.js → multipart-parser-ASKQAOL4-WZ47HU6G.js} +92 -125
- package/dist/{multipart-parser-NDLECNMN.js → multipart-parser-QCI3Y5IB.js} +66 -68
- package/dist/types.js +1 -1
- package/dist/{typescript-WN4QH2CP.js → typescript-2LKASCMC.js} +33 -33
- package/dist/{typescript-AILDXN3I.js → typescript-H3AVJ6KX.js} +32 -32
- package/dist/utils/byline.js +1 -1
- package/dist/utils/captureStdout.js +3 -3
- package/dist/utils/countModelsAndTypes.js +1 -1
- package/dist/utils/{getSchemaPathAndPrint.js → createMigration.js} +8 -8
- package/dist/utils/customColors.js +1 -1
- package/dist/utils/ensureDatabaseExists.js +7 -7
- package/dist/utils/errors.js +1 -1
- package/dist/utils/flagErrors.js +1 -1
- package/dist/utils/getDatabaseVersionSafe.js +5 -5
- package/dist/utils/handleEvaluateDataloss.js +1 -1
- package/dist/utils/introspectSql.js +5 -5
- package/dist/utils/isSchemaEmpty.js +1 -1
- package/dist/utils/listMigrations.js +25 -0
- package/dist/utils/now.js +1 -1
- package/dist/utils/printDatasource.js +1 -1
- package/dist/utils/printDatasources.js +5 -5
- package/dist/utils/printFiles.js +5 -5
- package/dist/utils/printIntrospectedSchema.js +1 -1
- package/dist/utils/printMigrationId.js +1 -1
- package/dist/utils/promptForMigrationName.js +3 -3
- package/dist/utils/removeSchemaFiles.js +1 -1
- package/dist/utils/replaceOrAddDatasource.js +1 -1
- package/dist/utils/replaceOrAddDatasource.test.js +1 -1
- package/dist/utils/saveSchemaFiles.js +1 -1
- package/dist/utils/seed.js +4 -7
- package/dist/utils/setupCockroach.js +3 -3
- package/dist/utils/setupMSSQL.js +1478 -707
- package/dist/utils/setupMongo.js +553 -552
- package/dist/utils/setupMysql.js +508 -563
- package/dist/utils/setupPostgres.js +3 -3
- package/dist/utils/spinner.js +4 -3
- package/dist/utils/test-handlePanic.js +1 -30
- package/dist/utils/unixSocket.js +1 -1
- package/dist/views/handleViewsIO.js +3 -3
- package/package.json +11 -11
- package/dist/chunk-GKDFIHM2.js +0 -45
- package/dist/chunk-J46BJQHT.js +0 -268
- package/dist/chunk-KOF4LGTS.js +0 -1817
- package/dist/chunk-YYPMC5FN.js +0 -1407
- package/dist/internals/src/get-generators/generatorResolvers/generatorResolvers.d.ts +0 -15
- package/dist/internals/src/get-generators/generatorResolvers/prisma-client-js/auto-installation/findPrismaClientDir.d.ts +0 -6
- package/dist/internals/src/get-generators/generatorResolvers/prisma-client-js/auto-installation/getPackageCmd.d.ts +0 -9
- package/dist/internals/src/get-generators/generatorResolvers/prisma-client-js/auto-installation/runPackageCmd.d.ts +0 -8
- package/dist/internals/src/get-generators/generatorResolvers/prisma-client-js/check-dependencies/checkTypeScriptVersion.d.ts +0 -6
- package/dist/internals/src/get-generators/generatorResolvers/prisma-client-js/check-dependencies/isYarnUsed.d.ts +0 -1
- package/dist/internals/src/get-generators/generatorResolvers/prisma-client-js/check-dependencies/resolve.d.ts +0 -20
- package/dist/internals/src/get-generators/generatorResolvers/prisma-client-js/check-dependencies/semverLt.d.ts +0 -7
- package/dist/internals/src/get-generators/generatorResolvers/prisma-client-js/prismaClientResolver.d.ts +0 -20
- package/dist/internals/src/get-generators/utils/check-feature-flags/checkFeatureFlags.d.ts +0 -8
- package/dist/migrate/src/utils/getSchemaPathAndPrint.d.ts +0 -10
package/dist/utils/setupMysql.js
CHANGED
|
@@ -32,13 +32,13 @@ __export(setupMysql_exports, {
|
|
|
32
32
|
tearDownMysql: () => tearDownMysql
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(setupMysql_exports);
|
|
35
|
-
var
|
|
36
|
-
var
|
|
37
|
-
var
|
|
35
|
+
var import_chunk_5R44VVVX = require("../chunk-5R44VVVX.js");
|
|
36
|
+
var import_chunk_33LPBNDX = require("../chunk-33LPBNDX.js");
|
|
37
|
+
var import_chunk_2ESYSVXG = require("../chunk-2ESYSVXG.js");
|
|
38
38
|
var import_internals = require("@prisma/internals");
|
|
39
39
|
var import_fs = __toESM(require("fs"));
|
|
40
40
|
var import_path = __toESM(require("path"));
|
|
41
|
-
var require_package = (0,
|
|
41
|
+
var require_package = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
42
42
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/package.json"(exports, module2) {
|
|
43
43
|
module2.exports = {
|
|
44
44
|
name: "mariadb",
|
|
@@ -121,7 +121,7 @@ var require_package = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
121
121
|
};
|
|
122
122
|
}
|
|
123
123
|
});
|
|
124
|
-
var require_check_node = (0,
|
|
124
|
+
var require_check_node = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
125
125
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/check-node.js"(exports, module2) {
|
|
126
126
|
"use strict";
|
|
127
127
|
var hasMinVersion = function(nodeVersionStr, connectorRequirement2) {
|
|
@@ -146,7 +146,7 @@ var require_check_node = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
148
|
});
|
|
149
|
-
var require_denque = (0,
|
|
149
|
+
var require_denque = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
150
150
|
"../../node_modules/.pnpm/denque@2.1.0/node_modules/denque/index.js"(exports, module2) {
|
|
151
151
|
"use strict";
|
|
152
152
|
function Denque(array, options) {
|
|
@@ -459,7 +459,7 @@ var require_denque = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
459
459
|
module2.exports = Denque;
|
|
460
460
|
}
|
|
461
461
|
});
|
|
462
|
-
var require_error_code = (0,
|
|
462
|
+
var require_error_code = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
463
463
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/const/error-code.js"(exports, module2) {
|
|
464
464
|
"use strict";
|
|
465
465
|
var codes = {};
|
|
@@ -1757,7 +1757,7 @@ var require_error_code = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
1757
1757
|
module2.exports.codes = codes;
|
|
1758
1758
|
}
|
|
1759
1759
|
});
|
|
1760
|
-
var require_errors = (0,
|
|
1760
|
+
var require_errors = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
1761
1761
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/misc/errors.js"(exports, module2) {
|
|
1762
1762
|
"use strict";
|
|
1763
1763
|
var ErrorCodes = require_error_code();
|
|
@@ -1860,7 +1860,7 @@ var require_errors = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
1860
1860
|
module2.exports.SqlError = SqlError;
|
|
1861
1861
|
}
|
|
1862
1862
|
});
|
|
1863
|
-
var require_packet = (0,
|
|
1863
|
+
var require_packet = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
1864
1864
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/io/packet.js"(exports, module2) {
|
|
1865
1865
|
"use strict";
|
|
1866
1866
|
var Errors = require_errors();
|
|
@@ -2335,7 +2335,7 @@ var require_packet = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
2335
2335
|
module2.exports = Packet;
|
|
2336
2336
|
}
|
|
2337
2337
|
});
|
|
2338
|
-
var require_packet_node_encoded = (0,
|
|
2338
|
+
var require_packet_node_encoded = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
2339
2339
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/io/packet-node-encoded.js"(exports, module2) {
|
|
2340
2340
|
"use strict";
|
|
2341
2341
|
var Packet = require_packet();
|
|
@@ -2366,11 +2366,11 @@ var require_packet_node_encoded = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
2366
2366
|
module2.exports = PacketNodeEncoded;
|
|
2367
2367
|
}
|
|
2368
2368
|
});
|
|
2369
|
-
var require_packet_node_iconv = (0,
|
|
2369
|
+
var require_packet_node_iconv = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
2370
2370
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/io/packet-node-iconv.js"(exports, module2) {
|
|
2371
2371
|
"use strict";
|
|
2372
2372
|
var Packet = require_packet();
|
|
2373
|
-
var Iconv = (0,
|
|
2373
|
+
var Iconv = (0, import_chunk_5R44VVVX.require_lib)();
|
|
2374
2374
|
var PacketIconvEncoded = class _PacketIconvEncoded extends Packet {
|
|
2375
2375
|
constructor(encoding) {
|
|
2376
2376
|
super();
|
|
@@ -2398,7 +2398,7 @@ var require_packet_node_iconv = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
2398
2398
|
module2.exports = PacketIconvEncoded;
|
|
2399
2399
|
}
|
|
2400
2400
|
});
|
|
2401
|
-
var require_collations = (0,
|
|
2401
|
+
var require_collations = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
2402
2402
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/const/collations.js"(exports, module2) {
|
|
2403
2403
|
"use strict";
|
|
2404
2404
|
var charsets = [];
|
|
@@ -3779,7 +3779,7 @@ var require_collations = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
3779
3779
|
module2.exports = Collation;
|
|
3780
3780
|
}
|
|
3781
3781
|
});
|
|
3782
|
-
var require_text_encoder = (0,
|
|
3782
|
+
var require_text_encoder = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
3783
3783
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/cmd/encoder/text-encoder.js"(exports, module2) {
|
|
3784
3784
|
"use strict";
|
|
3785
3785
|
var QUOTE = 39;
|
|
@@ -3988,12 +3988,12 @@ var require_text_encoder = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
3988
3988
|
module2.exports = TextEncoder;
|
|
3989
3989
|
}
|
|
3990
3990
|
});
|
|
3991
|
-
var require_utils = (0,
|
|
3991
|
+
var require_utils = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
3992
3992
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/misc/utils.js"(exports, module2) {
|
|
3993
3993
|
"use strict";
|
|
3994
3994
|
var hexArray = "0123456789ABCDEF".split("");
|
|
3995
3995
|
var Errors = require_errors();
|
|
3996
|
-
var Iconv = (0,
|
|
3996
|
+
var Iconv = (0, import_chunk_5R44VVVX.require_lib)();
|
|
3997
3997
|
var TextEncoder = require_text_encoder();
|
|
3998
3998
|
module2.exports.log = function(opts, buf, off, end, header) {
|
|
3999
3999
|
let out = [];
|
|
@@ -4187,7 +4187,7 @@ var require_utils = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
4187
4187
|
module2.exports.escape = escapeParameters;
|
|
4188
4188
|
}
|
|
4189
4189
|
});
|
|
4190
|
-
var require_packet_input_stream = (0,
|
|
4190
|
+
var require_packet_input_stream = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
4191
4191
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/io/packet-input-stream.js"(exports, module2) {
|
|
4192
4192
|
"use strict";
|
|
4193
4193
|
var PacketNodeEncoded = require_packet_node_encoded();
|
|
@@ -4352,10 +4352,10 @@ ${Utils.log(this.opts, packet.buf, packet.pos, packet.end, this.header)}`
|
|
|
4352
4352
|
module2.exports = PacketInputStream;
|
|
4353
4353
|
}
|
|
4354
4354
|
});
|
|
4355
|
-
var require_packet_output_stream = (0,
|
|
4355
|
+
var require_packet_output_stream = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
4356
4356
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/io/packet-output-stream.js"(exports, module2) {
|
|
4357
4357
|
"use strict";
|
|
4358
|
-
var Iconv = (0,
|
|
4358
|
+
var Iconv = (0, import_chunk_5R44VVVX.require_lib)();
|
|
4359
4359
|
var Utils = require_utils();
|
|
4360
4360
|
var Errors = require_errors();
|
|
4361
4361
|
var Collations = require_collations();
|
|
@@ -4981,10 +4981,10 @@ ${Utils.log(
|
|
|
4981
4981
|
module2.exports = PacketOutputStream;
|
|
4982
4982
|
}
|
|
4983
4983
|
});
|
|
4984
|
-
var require_compression_input_stream = (0,
|
|
4984
|
+
var require_compression_input_stream = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
4985
4985
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/io/compression-input-stream.js"(exports, module2) {
|
|
4986
4986
|
"use strict";
|
|
4987
|
-
var ZLib = (0,
|
|
4987
|
+
var ZLib = (0, import_chunk_2ESYSVXG.__require)("zlib");
|
|
4988
4988
|
var Utils = require_utils();
|
|
4989
4989
|
var CompressionInputStream = class {
|
|
4990
4990
|
constructor(reader, receiveQueue, opts, info) {
|
|
@@ -5103,11 +5103,11 @@ ${Utils.log(this.opts, chunk, 0, chunk.length, this.header)}`
|
|
|
5103
5103
|
module2.exports = CompressionInputStream;
|
|
5104
5104
|
}
|
|
5105
5105
|
});
|
|
5106
|
-
var require_compression_output_stream = (0,
|
|
5106
|
+
var require_compression_output_stream = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
5107
5107
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/io/compression-output-stream.js"(exports, module2) {
|
|
5108
5108
|
"use strict";
|
|
5109
5109
|
var Utils = require_utils();
|
|
5110
|
-
var ZLib = (0,
|
|
5110
|
+
var ZLib = (0, import_chunk_2ESYSVXG.__require)("zlib");
|
|
5111
5111
|
var SMALL_BUFFER_SIZE = 2048;
|
|
5112
5112
|
var MEDIUM_BUFFER_SIZE = 131072;
|
|
5113
5113
|
var LARGE_BUFFER_SIZE = 1048576;
|
|
@@ -5234,7 +5234,7 @@ ${Utils.log(this.opts, emptyBuf, 0, 7)}`
|
|
|
5234
5234
|
module2.exports = CompressionOutputStream;
|
|
5235
5235
|
}
|
|
5236
5236
|
});
|
|
5237
|
-
var require_server_status = (0,
|
|
5237
|
+
var require_server_status = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
5238
5238
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/const/server-status.js"(exports, module2) {
|
|
5239
5239
|
"use strict";
|
|
5240
5240
|
module2.exports.STATUS_IN_TRANS = 1;
|
|
@@ -5253,20 +5253,19 @@ var require_server_status = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
5253
5253
|
module2.exports.SESSION_STATE_CHANGED = 1 << 14;
|
|
5254
5254
|
}
|
|
5255
5255
|
});
|
|
5256
|
-
var require_connection_information = (0,
|
|
5256
|
+
var require_connection_information = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
5257
5257
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/misc/connection-information.js"(exports, module2) {
|
|
5258
5258
|
"use strict";
|
|
5259
|
-
var _redirectFct;
|
|
5260
5259
|
var ConnectionInformation = class {
|
|
5260
|
+
#redirectFct;
|
|
5261
5261
|
constructor(opts, redirectFct) {
|
|
5262
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _redirectFct);
|
|
5263
5262
|
this.threadId = -1;
|
|
5264
5263
|
this.status = null;
|
|
5265
5264
|
this.serverVersion = null;
|
|
5266
5265
|
this.serverCapabilities = null;
|
|
5267
5266
|
this.database = opts.database;
|
|
5268
5267
|
this.port = opts.port;
|
|
5269
|
-
|
|
5268
|
+
this.#redirectFct = redirectFct;
|
|
5270
5269
|
this.redirectRequest = null;
|
|
5271
5270
|
}
|
|
5272
5271
|
hasMinVersion(major, minor, patch) {
|
|
@@ -5278,7 +5277,7 @@ var require_connection_information = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
5278
5277
|
return ver.major > major || ver.major === major && ver.minor > minor || ver.major === major && ver.minor === minor && ver.patch >= patch;
|
|
5279
5278
|
}
|
|
5280
5279
|
redirect(value, resolve) {
|
|
5281
|
-
return
|
|
5280
|
+
return this.#redirectFct(value, resolve);
|
|
5282
5281
|
}
|
|
5283
5282
|
isMariaDB() {
|
|
5284
5283
|
if (!this.serverVersion) throw new Error("cannot know if server is MariaDB until connection is established");
|
|
@@ -5316,11 +5315,10 @@ var require_connection_information = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
5316
5315
|
if (type === 2) info.serverVersion.patch = val;
|
|
5317
5316
|
}
|
|
5318
5317
|
};
|
|
5319
|
-
_redirectFct = /* @__PURE__ */ new WeakMap();
|
|
5320
5318
|
module2.exports = ConnectionInformation;
|
|
5321
5319
|
}
|
|
5322
5320
|
});
|
|
5323
|
-
var require_capabilities = (0,
|
|
5321
|
+
var require_capabilities = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
5324
5322
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/const/capabilities.js"(exports, module2) {
|
|
5325
5323
|
"use strict";
|
|
5326
5324
|
module2.exports.MYSQL = 1n;
|
|
@@ -5354,7 +5352,7 @@ var require_capabilities = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
5354
5352
|
module2.exports.MARIADB_CLIENT_CACHE_METADATA = 1n << 36n;
|
|
5355
5353
|
}
|
|
5356
5354
|
});
|
|
5357
|
-
var require_connection_options = (0,
|
|
5355
|
+
var require_connection_options = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
5358
5356
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/config/connection-options.js"(exports, module2) {
|
|
5359
5357
|
"use strict";
|
|
5360
5358
|
var Collations = require_collations();
|
|
@@ -5585,10 +5583,10 @@ var require_connection_options = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
5585
5583
|
module2.exports = ConnectionOptions;
|
|
5586
5584
|
}
|
|
5587
5585
|
});
|
|
5588
|
-
var require_command = (0,
|
|
5586
|
+
var require_command = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
5589
5587
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/cmd/command.js"(exports, module2) {
|
|
5590
5588
|
"use strict";
|
|
5591
|
-
var EventEmitter = (0,
|
|
5589
|
+
var EventEmitter = (0, import_chunk_2ESYSVXG.__require)("events");
|
|
5592
5590
|
var Errors = require_errors();
|
|
5593
5591
|
var Command = class extends EventEmitter {
|
|
5594
5592
|
constructor(cmdParam, resolve, reject) {
|
|
@@ -5708,7 +5706,7 @@ var require_command = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
5708
5706
|
module2.exports = Command;
|
|
5709
5707
|
}
|
|
5710
5708
|
});
|
|
5711
|
-
var require_plugin_auth = (0,
|
|
5709
|
+
var require_plugin_auth = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
5712
5710
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/cmd/handshake/auth/plugin-auth.js"(exports, module2) {
|
|
5713
5711
|
"use strict";
|
|
5714
5712
|
var Command = require_command();
|
|
@@ -5727,7 +5725,7 @@ var require_plugin_auth = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
5727
5725
|
module2.exports = PluginAuth;
|
|
5728
5726
|
}
|
|
5729
5727
|
});
|
|
5730
|
-
var require_initial_handshake = (0,
|
|
5728
|
+
var require_initial_handshake = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
5731
5729
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/cmd/handshake/auth/initial-handshake.js"(exports, module2) {
|
|
5732
5730
|
"use strict";
|
|
5733
5731
|
var Capabilities = require_capabilities();
|
|
@@ -5782,7 +5780,7 @@ var require_initial_handshake = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
5782
5780
|
module2.exports = InitialHandshake;
|
|
5783
5781
|
}
|
|
5784
5782
|
});
|
|
5785
|
-
var require_client_capabilities = (0,
|
|
5783
|
+
var require_client_capabilities = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
5786
5784
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/cmd/handshake/client-capabilities.js"(exports, module2) {
|
|
5787
5785
|
"use strict";
|
|
5788
5786
|
var Capabilities = require_capabilities();
|
|
@@ -5825,7 +5823,7 @@ var require_client_capabilities = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
5825
5823
|
};
|
|
5826
5824
|
}
|
|
5827
5825
|
});
|
|
5828
|
-
var require_ssl_request = (0,
|
|
5826
|
+
var require_ssl_request = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
5829
5827
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/cmd/handshake/ssl-request.js"(exports, module2) {
|
|
5830
5828
|
"use strict";
|
|
5831
5829
|
var Capabilities = require_capabilities();
|
|
@@ -5846,11 +5844,11 @@ var require_ssl_request = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
5846
5844
|
};
|
|
5847
5845
|
}
|
|
5848
5846
|
});
|
|
5849
|
-
var require_native_password_auth = (0,
|
|
5847
|
+
var require_native_password_auth = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
5850
5848
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/cmd/handshake/auth/native-password-auth.js"(exports, module2) {
|
|
5851
5849
|
"use strict";
|
|
5852
5850
|
var PluginAuth = require_plugin_auth();
|
|
5853
|
-
var Crypto = (0,
|
|
5851
|
+
var Crypto = (0, import_chunk_2ESYSVXG.__require)("crypto");
|
|
5854
5852
|
var NativePasswordAuth = class _NativePasswordAuth extends PluginAuth {
|
|
5855
5853
|
constructor(packSeq, compressPackSeq, pluginData, cmdParam, reject, multiAuthResolver) {
|
|
5856
5854
|
super(cmdParam, multiAuthResolver, reject);
|
|
@@ -5899,7 +5897,7 @@ var require_native_password_auth = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
5899
5897
|
module2.exports = NativePasswordAuth;
|
|
5900
5898
|
}
|
|
5901
5899
|
});
|
|
5902
|
-
var require_handshake = (0,
|
|
5900
|
+
var require_handshake = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
5903
5901
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/cmd/handshake/auth/handshake.js"(exports, module2) {
|
|
5904
5902
|
"use strict";
|
|
5905
5903
|
var PluginAuth = require_plugin_auth();
|
|
@@ -5909,9 +5907,9 @@ var require_handshake = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
5909
5907
|
var SslRequest = require_ssl_request();
|
|
5910
5908
|
var Errors = require_errors();
|
|
5911
5909
|
var NativePasswordAuth = require_native_password_auth();
|
|
5912
|
-
var os = (0,
|
|
5913
|
-
var Iconv = (0,
|
|
5914
|
-
var Crypto = (0,
|
|
5910
|
+
var os = (0, import_chunk_2ESYSVXG.__require)("os");
|
|
5911
|
+
var Iconv = (0, import_chunk_5R44VVVX.require_lib)();
|
|
5912
|
+
var Crypto = (0, import_chunk_2ESYSVXG.__require)("crypto");
|
|
5915
5913
|
var driverVersion = require_package().version;
|
|
5916
5914
|
var Handshake = class _Handshake extends PluginAuth {
|
|
5917
5915
|
constructor(auth, getSocket, multiAuthResolver, reject) {
|
|
@@ -6064,7 +6062,7 @@ var require_handshake = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
6064
6062
|
module2.exports = Handshake;
|
|
6065
6063
|
}
|
|
6066
6064
|
});
|
|
6067
|
-
var require_state_change = (0,
|
|
6065
|
+
var require_state_change = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
6068
6066
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/const/state-change.js"(exports, module2) {
|
|
6069
6067
|
"use strict";
|
|
6070
6068
|
module2.exports.SESSION_TRACK_SYSTEM_VARIABLES = 0;
|
|
@@ -6075,7 +6073,7 @@ var require_state_change = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
6075
6073
|
module2.exports.SESSION_TRACK_TRANSACTION_STATE = 5;
|
|
6076
6074
|
}
|
|
6077
6075
|
});
|
|
6078
|
-
var require_clear_password_auth = (0,
|
|
6076
|
+
var require_clear_password_auth = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
6079
6077
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/cmd/handshake/auth/clear-password-auth.js"(exports, module2) {
|
|
6080
6078
|
"use strict";
|
|
6081
6079
|
var PluginAuth = require_plugin_auth();
|
|
@@ -6123,11 +6121,11 @@ var require_clear_password_auth = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
6123
6121
|
module2.exports = ClearPasswordAuth;
|
|
6124
6122
|
}
|
|
6125
6123
|
});
|
|
6126
|
-
var require_ed25519_password_auth = (0,
|
|
6124
|
+
var require_ed25519_password_auth = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
6127
6125
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/cmd/handshake/auth/ed25519-password-auth.js"(exports, module2) {
|
|
6128
6126
|
"use strict";
|
|
6129
6127
|
var PluginAuth = require_plugin_auth();
|
|
6130
|
-
var Crypto = (0,
|
|
6128
|
+
var Crypto = (0, import_chunk_2ESYSVXG.__require)("crypto");
|
|
6131
6129
|
var Ed25519PasswordAuth = class _Ed25519PasswordAuth extends PluginAuth {
|
|
6132
6130
|
constructor(packSeq, compressPackSeq, pluginData, cmdParam, reject, multiAuthResolver) {
|
|
6133
6131
|
super(cmdParam, multiAuthResolver, reject);
|
|
@@ -6862,11 +6860,11 @@ var require_ed25519_password_auth = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
6862
6860
|
module2.exports = Ed25519PasswordAuth;
|
|
6863
6861
|
}
|
|
6864
6862
|
});
|
|
6865
|
-
var require_parsec_auth = (0,
|
|
6863
|
+
var require_parsec_auth = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
6866
6864
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/cmd/handshake/auth/parsec-auth.js"(exports, module2) {
|
|
6867
6865
|
"use strict";
|
|
6868
6866
|
var PluginAuth = require_plugin_auth();
|
|
6869
|
-
var crypto = (0,
|
|
6867
|
+
var crypto = (0, import_chunk_2ESYSVXG.__require)("crypto");
|
|
6870
6868
|
var Errors = require_errors();
|
|
6871
6869
|
var ParsecAuth = class extends PluginAuth {
|
|
6872
6870
|
constructor(packSeq, compressPackSeq, pluginData, cmdParam, reject, multiAuthResolver) {
|
|
@@ -6922,7 +6920,7 @@ var require_parsec_auth = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
6922
6920
|
module2.exports = ParsecAuth;
|
|
6923
6921
|
}
|
|
6924
6922
|
});
|
|
6925
|
-
var require_pam_password_auth = (0,
|
|
6923
|
+
var require_pam_password_auth = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
6926
6924
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/cmd/handshake/auth/pam-password-auth.js"(exports, module2) {
|
|
6927
6925
|
"use strict";
|
|
6928
6926
|
var PluginAuth = require_plugin_auth();
|
|
@@ -6972,14 +6970,14 @@ var require_pam_password_auth = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
6972
6970
|
module2.exports = PamPasswordAuth;
|
|
6973
6971
|
}
|
|
6974
6972
|
});
|
|
6975
|
-
var require_sha256_password_auth = (0,
|
|
6973
|
+
var require_sha256_password_auth = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
6976
6974
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/cmd/handshake/auth/sha256-password-auth.js"(exports, module2) {
|
|
6977
6975
|
"use strict";
|
|
6978
6976
|
var PluginAuth = require_plugin_auth();
|
|
6979
|
-
var fs2 = (0,
|
|
6980
|
-
var crypto = (0,
|
|
6977
|
+
var fs2 = (0, import_chunk_2ESYSVXG.__require)("fs");
|
|
6978
|
+
var crypto = (0, import_chunk_2ESYSVXG.__require)("crypto");
|
|
6981
6979
|
var Errors = require_errors();
|
|
6982
|
-
var Crypto = (0,
|
|
6980
|
+
var Crypto = (0, import_chunk_2ESYSVXG.__require)("crypto");
|
|
6983
6981
|
var Sha256PasswordAuth = class _Sha256PasswordAuth extends PluginAuth {
|
|
6984
6982
|
constructor(packSeq, compressPackSeq, pluginData, cmdParam, reject, multiAuthResolver) {
|
|
6985
6983
|
super(cmdParam, multiAuthResolver, reject);
|
|
@@ -7100,11 +7098,11 @@ var require_sha256_password_auth = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
7100
7098
|
module2.exports = Sha256PasswordAuth;
|
|
7101
7099
|
}
|
|
7102
7100
|
});
|
|
7103
|
-
var require_caching_sha2_password_auth = (0,
|
|
7101
|
+
var require_caching_sha2_password_auth = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
7104
7102
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/cmd/handshake/auth/caching-sha2-password-auth.js"(exports, module2) {
|
|
7105
7103
|
"use strict";
|
|
7106
7104
|
var PluginAuth = require_plugin_auth();
|
|
7107
|
-
var fs2 = (0,
|
|
7105
|
+
var fs2 = (0, import_chunk_2ESYSVXG.__require)("fs");
|
|
7108
7106
|
var Errors = require_errors();
|
|
7109
7107
|
var Sha256PasswordAuth = require_sha256_password_auth();
|
|
7110
7108
|
var State = {
|
|
@@ -7210,7 +7208,7 @@ var require_caching_sha2_password_auth = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
7210
7208
|
module2.exports = CachingSha2PasswordAuth;
|
|
7211
7209
|
}
|
|
7212
7210
|
});
|
|
7213
|
-
var require_authentication = (0,
|
|
7211
|
+
var require_authentication = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
7214
7212
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/cmd/handshake/authentication.js"(exports, module2) {
|
|
7215
7213
|
"use strict";
|
|
7216
7214
|
var Command = require_command();
|
|
@@ -7220,9 +7218,9 @@ var require_authentication = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
7220
7218
|
var ServerStatus = require_server_status();
|
|
7221
7219
|
var StateChange = require_state_change();
|
|
7222
7220
|
var Collations = require_collations();
|
|
7223
|
-
var Crypto = (0,
|
|
7221
|
+
var Crypto = (0, import_chunk_2ESYSVXG.__require)("crypto");
|
|
7224
7222
|
var utils = require_utils();
|
|
7225
|
-
var tls = (0,
|
|
7223
|
+
var tls = (0, import_chunk_2ESYSVXG.__require)("tls");
|
|
7226
7224
|
var authenticationPlugins = {
|
|
7227
7225
|
mysql_native_password: require_native_password_auth(),
|
|
7228
7226
|
mysql_clear_password: require_clear_password_auth(),
|
|
@@ -7479,7 +7477,7 @@ var require_authentication = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
7479
7477
|
module2.exports = Authentication;
|
|
7480
7478
|
}
|
|
7481
7479
|
});
|
|
7482
|
-
var require_quit = (0,
|
|
7480
|
+
var require_quit = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
7483
7481
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/cmd/quit.js"(exports, module2) {
|
|
7484
7482
|
"use strict";
|
|
7485
7483
|
var Command = require_command();
|
|
@@ -7501,7 +7499,7 @@ var require_quit = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
7501
7499
|
module2.exports = Quit;
|
|
7502
7500
|
}
|
|
7503
7501
|
});
|
|
7504
|
-
var require_ping = (0,
|
|
7502
|
+
var require_ping = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
7505
7503
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/cmd/ping.js"(exports, module2) {
|
|
7506
7504
|
"use strict";
|
|
7507
7505
|
var Command = require_command();
|
|
@@ -7543,7 +7541,7 @@ var require_ping = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
7543
7541
|
module2.exports = Ping;
|
|
7544
7542
|
}
|
|
7545
7543
|
});
|
|
7546
|
-
var require_reset = (0,
|
|
7544
|
+
var require_reset = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
7547
7545
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/cmd/reset.js"(exports, module2) {
|
|
7548
7546
|
"use strict";
|
|
7549
7547
|
var Command = require_command();
|
|
@@ -7585,7 +7583,7 @@ var require_reset = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
7585
7583
|
module2.exports = Reset;
|
|
7586
7584
|
}
|
|
7587
7585
|
});
|
|
7588
|
-
var require_field_type = (0,
|
|
7586
|
+
var require_field_type = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
7589
7587
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/const/field-type.js"(exports, module2) {
|
|
7590
7588
|
"use strict";
|
|
7591
7589
|
module2.exports.DECIMAL = 0;
|
|
@@ -7654,7 +7652,7 @@ var require_field_type = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
7654
7652
|
module2.exports.TYPES = typeNames;
|
|
7655
7653
|
}
|
|
7656
7654
|
});
|
|
7657
|
-
var require_field_detail = (0,
|
|
7655
|
+
var require_field_detail = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
7658
7656
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/const/field-detail.js"(exports, module2) {
|
|
7659
7657
|
"use strict";
|
|
7660
7658
|
module2.exports.NOT_NULL = 1;
|
|
@@ -7674,18 +7672,17 @@ var require_field_detail = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
7674
7672
|
module2.exports.NUM_FLAG = 1 << 14;
|
|
7675
7673
|
}
|
|
7676
7674
|
});
|
|
7677
|
-
var require_column_definition = (0,
|
|
7675
|
+
var require_column_definition = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
7678
7676
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/cmd/column-definition.js"(exports, module2) {
|
|
7679
7677
|
"use strict";
|
|
7680
7678
|
var Collations = require_collations();
|
|
7681
7679
|
var FieldType = require_field_type();
|
|
7682
7680
|
var FieldDetails = require_field_detail();
|
|
7683
7681
|
var Capabilities = require_capabilities();
|
|
7684
|
-
var _stringParser;
|
|
7685
7682
|
var ColumnDef = class {
|
|
7683
|
+
#stringParser;
|
|
7686
7684
|
constructor(packet, info, skipName) {
|
|
7687
|
-
(
|
|
7688
|
-
(0, import_chunk_WWAWV7DQ.__privateSet)(this, _stringParser, skipName ? new StringParser(packet) : new StringParserWithName(packet));
|
|
7685
|
+
this.#stringParser = skipName ? new StringParser(packet) : new StringParserWithName(packet);
|
|
7689
7686
|
if (info.clientCapabilities & Capabilities.MARIADB_CLIENT_EXTENDED_TYPE_INFO) {
|
|
7690
7687
|
const len = packet.readUnsignedLength();
|
|
7691
7688
|
if (len > 0) {
|
|
@@ -7735,22 +7732,22 @@ var require_column_definition = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
7735
7732
|
return null;
|
|
7736
7733
|
}
|
|
7737
7734
|
db() {
|
|
7738
|
-
return
|
|
7735
|
+
return this.#stringParser.db();
|
|
7739
7736
|
}
|
|
7740
7737
|
schema() {
|
|
7741
|
-
return
|
|
7738
|
+
return this.#stringParser.schema();
|
|
7742
7739
|
}
|
|
7743
7740
|
table() {
|
|
7744
|
-
return
|
|
7741
|
+
return this.#stringParser.table();
|
|
7745
7742
|
}
|
|
7746
7743
|
orgTable() {
|
|
7747
|
-
return
|
|
7744
|
+
return this.#stringParser.orgTable();
|
|
7748
7745
|
}
|
|
7749
7746
|
name() {
|
|
7750
|
-
return
|
|
7747
|
+
return this.#stringParser.name();
|
|
7751
7748
|
}
|
|
7752
7749
|
orgName() {
|
|
7753
|
-
return
|
|
7750
|
+
return this.#stringParser.orgName();
|
|
7754
7751
|
}
|
|
7755
7752
|
signed() {
|
|
7756
7753
|
return (this.flags & FieldDetails.UNSIGNED) === 0;
|
|
@@ -7759,7 +7756,6 @@ var require_column_definition = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
7759
7756
|
return (this.flags & FieldDetails.SET) !== 0;
|
|
7760
7757
|
}
|
|
7761
7758
|
};
|
|
7762
|
-
_stringParser = /* @__PURE__ */ new WeakMap();
|
|
7763
7759
|
var BaseStringParser = class {
|
|
7764
7760
|
constructor(encoding, readFct, saveBuf, initialPos) {
|
|
7765
7761
|
this.buf = saveBuf;
|
|
@@ -7810,6 +7806,7 @@ var require_column_definition = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
7810
7806
|
}
|
|
7811
7807
|
};
|
|
7812
7808
|
var StringParserWithName = class extends BaseStringParser {
|
|
7809
|
+
colName;
|
|
7813
7810
|
constructor(packet) {
|
|
7814
7811
|
packet.skip(packet.readMetadataLength());
|
|
7815
7812
|
const initPos = packet.pos;
|
|
@@ -7819,7 +7816,6 @@ var require_column_definition = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
7819
7816
|
const colName = packet.readStringLengthEncoded();
|
|
7820
7817
|
packet.skip(packet.readMetadataLength());
|
|
7821
7818
|
super(packet.encoding, packet.constructor.readString, packet.buf, initPos);
|
|
7822
|
-
(0, import_chunk_WWAWV7DQ.__publicField)(this, "colName");
|
|
7823
7819
|
this.colName = colName;
|
|
7824
7820
|
}
|
|
7825
7821
|
name() {
|
|
@@ -7829,7 +7825,7 @@ var require_column_definition = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
7829
7825
|
module2.exports = ColumnDef;
|
|
7830
7826
|
}
|
|
7831
7827
|
});
|
|
7832
|
-
var require_parse = (0,
|
|
7828
|
+
var require_parse = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
7833
7829
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/misc/parse.js"(exports, module2) {
|
|
7834
7830
|
"use strict";
|
|
7835
7831
|
var Errors = require_errors();
|
|
@@ -8241,7 +8237,7 @@ var require_parse = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
8241
8237
|
};
|
|
8242
8238
|
}
|
|
8243
8239
|
});
|
|
8244
|
-
var require_binary_decoder = (0,
|
|
8240
|
+
var require_binary_decoder = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
8245
8241
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/cmd/decoder/binary-decoder.js"(exports, module2) {
|
|
8246
8242
|
"use strict";
|
|
8247
8243
|
var FieldType = require_field_type();
|
|
@@ -8477,7 +8473,7 @@ var require_binary_decoder = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
8477
8473
|
DEFAULT_UNSIGNED_PARSER_TYPE[FieldType.TIME] = readTimeBinary;
|
|
8478
8474
|
}
|
|
8479
8475
|
});
|
|
8480
|
-
var require_text_decoder = (0,
|
|
8476
|
+
var require_text_decoder = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
8481
8477
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/cmd/decoder/text-decoder.js"(exports, module2) {
|
|
8482
8478
|
"use strict";
|
|
8483
8479
|
var FieldType = require_field_type();
|
|
@@ -8653,7 +8649,7 @@ var require_text_decoder = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
8653
8649
|
DEFAULT_PARSER_TYPE[FieldType.TIME] = readAsciiStringLengthEncoded;
|
|
8654
8650
|
}
|
|
8655
8651
|
});
|
|
8656
|
-
var require_ok_packet = (0,
|
|
8652
|
+
var require_ok_packet = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
8657
8653
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/cmd/class/ok-packet.js"(exports, module2) {
|
|
8658
8654
|
"use strict";
|
|
8659
8655
|
var OkPacket = class {
|
|
@@ -8666,14 +8662,14 @@ var require_ok_packet = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
8666
8662
|
module2.exports = OkPacket;
|
|
8667
8663
|
}
|
|
8668
8664
|
});
|
|
8669
|
-
var require_parser = (0,
|
|
8665
|
+
var require_parser = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
8670
8666
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/cmd/parser.js"(exports, module2) {
|
|
8671
8667
|
"use strict";
|
|
8672
8668
|
var Command = require_command();
|
|
8673
8669
|
var ServerStatus = require_server_status();
|
|
8674
8670
|
var ColumnDefinition = require_column_definition();
|
|
8675
8671
|
var Errors = require_errors();
|
|
8676
|
-
var fs2 = (0,
|
|
8672
|
+
var fs2 = (0, import_chunk_2ESYSVXG.__require)("fs");
|
|
8677
8673
|
var Parse = require_parse();
|
|
8678
8674
|
var BinaryDecoder = require_binary_decoder();
|
|
8679
8675
|
var TextDecoder = require_text_decoder();
|
|
@@ -9275,14 +9271,14 @@ var require_parser = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
9275
9271
|
module2.exports = Parser;
|
|
9276
9272
|
}
|
|
9277
9273
|
});
|
|
9278
|
-
var require_query = (0,
|
|
9274
|
+
var require_query = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
9279
9275
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/cmd/query.js"(exports, module2) {
|
|
9280
9276
|
"use strict";
|
|
9281
9277
|
var Parser = require_parser();
|
|
9282
9278
|
var Errors = require_errors();
|
|
9283
9279
|
var Parse = require_parse();
|
|
9284
9280
|
var TextEncoder = require_text_encoder();
|
|
9285
|
-
var { Readable } = (0,
|
|
9281
|
+
var { Readable } = (0, import_chunk_2ESYSVXG.__require)("stream");
|
|
9286
9282
|
var QUOTE = 39;
|
|
9287
9283
|
var Query = class extends Parser {
|
|
9288
9284
|
constructor(resolve, reject, connOpts, cmdParam) {
|
|
@@ -9590,7 +9586,7 @@ var require_query = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
9590
9586
|
module2.exports = Query;
|
|
9591
9587
|
}
|
|
9592
9588
|
});
|
|
9593
|
-
var require_binary_encoder = (0,
|
|
9589
|
+
var require_binary_encoder = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
9594
9590
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/cmd/encoder/binary-encoder.js"(exports, module2) {
|
|
9595
9591
|
"use strict";
|
|
9596
9592
|
var BinaryEncoder = class {
|
|
@@ -9829,106 +9825,97 @@ var require_binary_encoder = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
9829
9825
|
module2.exports = BinaryEncoder;
|
|
9830
9826
|
}
|
|
9831
9827
|
});
|
|
9832
|
-
var require_prepare_wrapper = (0,
|
|
9828
|
+
var require_prepare_wrapper = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
9833
9829
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/cmd/class/prepare-wrapper.js"(exports, module2) {
|
|
9834
9830
|
"use strict";
|
|
9835
|
-
var _closed, _cacheWrapper, _prepare, _conn;
|
|
9836
9831
|
var PrepareWrapper = class {
|
|
9832
|
+
#closed = false;
|
|
9833
|
+
#cacheWrapper;
|
|
9834
|
+
#prepare;
|
|
9835
|
+
#conn;
|
|
9837
9836
|
constructor(cacheWrapper, prepare) {
|
|
9838
|
-
|
|
9839
|
-
|
|
9840
|
-
|
|
9841
|
-
|
|
9842
|
-
|
|
9843
|
-
(0, import_chunk_WWAWV7DQ.__privateSet)(this, _prepare, prepare);
|
|
9844
|
-
(0, import_chunk_WWAWV7DQ.__privateSet)(this, _conn, prepare.conn);
|
|
9845
|
-
this.execute = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _prepare).execute;
|
|
9846
|
-
this.executeStream = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _prepare).executeStream;
|
|
9837
|
+
this.#cacheWrapper = cacheWrapper;
|
|
9838
|
+
this.#prepare = prepare;
|
|
9839
|
+
this.#conn = prepare.conn;
|
|
9840
|
+
this.execute = this.#prepare.execute;
|
|
9841
|
+
this.executeStream = this.#prepare.executeStream;
|
|
9847
9842
|
}
|
|
9848
9843
|
get conn() {
|
|
9849
|
-
return
|
|
9844
|
+
return this.#conn;
|
|
9850
9845
|
}
|
|
9851
9846
|
get id() {
|
|
9852
|
-
return
|
|
9847
|
+
return this.#prepare.id;
|
|
9853
9848
|
}
|
|
9854
9849
|
get parameterCount() {
|
|
9855
|
-
return
|
|
9850
|
+
return this.#prepare.parameterCount;
|
|
9856
9851
|
}
|
|
9857
9852
|
get _placeHolderIndex() {
|
|
9858
|
-
return
|
|
9853
|
+
return this.#prepare._placeHolderIndex;
|
|
9859
9854
|
}
|
|
9860
9855
|
get columns() {
|
|
9861
|
-
return
|
|
9856
|
+
return this.#prepare.columns;
|
|
9862
9857
|
}
|
|
9863
9858
|
set columns(columns) {
|
|
9864
|
-
|
|
9859
|
+
this.#prepare.columns = columns;
|
|
9865
9860
|
}
|
|
9866
9861
|
get database() {
|
|
9867
|
-
return
|
|
9862
|
+
return this.#prepare.database;
|
|
9868
9863
|
}
|
|
9869
9864
|
get query() {
|
|
9870
|
-
return
|
|
9865
|
+
return this.#prepare.query;
|
|
9871
9866
|
}
|
|
9872
9867
|
isClose() {
|
|
9873
|
-
return
|
|
9868
|
+
return this.#closed;
|
|
9874
9869
|
}
|
|
9875
9870
|
close() {
|
|
9876
|
-
if (!
|
|
9877
|
-
|
|
9878
|
-
|
|
9871
|
+
if (!this.#closed) {
|
|
9872
|
+
this.#closed = true;
|
|
9873
|
+
this.#cacheWrapper.decrementUse();
|
|
9879
9874
|
}
|
|
9880
9875
|
}
|
|
9881
9876
|
toString() {
|
|
9882
|
-
return "PrepareWrapper{closed:" +
|
|
9877
|
+
return "PrepareWrapper{closed:" + this.#closed + ",cache:" + this.#cacheWrapper + "}";
|
|
9883
9878
|
}
|
|
9884
9879
|
};
|
|
9885
|
-
_closed = /* @__PURE__ */ new WeakMap();
|
|
9886
|
-
_cacheWrapper = /* @__PURE__ */ new WeakMap();
|
|
9887
|
-
_prepare = /* @__PURE__ */ new WeakMap();
|
|
9888
|
-
_conn = /* @__PURE__ */ new WeakMap();
|
|
9889
9880
|
module2.exports = PrepareWrapper;
|
|
9890
9881
|
}
|
|
9891
9882
|
});
|
|
9892
|
-
var require_prepare_cache_wrapper = (0,
|
|
9883
|
+
var require_prepare_cache_wrapper = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
9893
9884
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/cmd/class/prepare-cache-wrapper.js"(exports, module2) {
|
|
9894
9885
|
"use strict";
|
|
9895
9886
|
var PrepareWrapper = require_prepare_wrapper();
|
|
9896
|
-
var _use, _cached, _prepare;
|
|
9897
9887
|
var PrepareCacheWrapper = class {
|
|
9888
|
+
#use = 0;
|
|
9889
|
+
#cached;
|
|
9890
|
+
#prepare;
|
|
9898
9891
|
constructor(prepare) {
|
|
9899
|
-
|
|
9900
|
-
|
|
9901
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _prepare);
|
|
9902
|
-
(0, import_chunk_WWAWV7DQ.__privateSet)(this, _prepare, prepare);
|
|
9903
|
-
(0, import_chunk_WWAWV7DQ.__privateSet)(this, _cached, true);
|
|
9892
|
+
this.#prepare = prepare;
|
|
9893
|
+
this.#cached = true;
|
|
9904
9894
|
}
|
|
9905
9895
|
incrementUse() {
|
|
9906
|
-
|
|
9907
|
-
return new PrepareWrapper(this,
|
|
9896
|
+
this.#use += 1;
|
|
9897
|
+
return new PrepareWrapper(this, this.#prepare);
|
|
9908
9898
|
}
|
|
9909
9899
|
unCache() {
|
|
9910
|
-
|
|
9911
|
-
if (
|
|
9912
|
-
|
|
9900
|
+
this.#cached = false;
|
|
9901
|
+
if (this.#use === 0) {
|
|
9902
|
+
this.#prepare.close();
|
|
9913
9903
|
}
|
|
9914
9904
|
}
|
|
9915
9905
|
decrementUse() {
|
|
9916
|
-
|
|
9917
|
-
if (
|
|
9918
|
-
|
|
9906
|
+
this.#use -= 1;
|
|
9907
|
+
if (this.#use === 0 && !this.#cached) {
|
|
9908
|
+
this.#prepare.close();
|
|
9919
9909
|
}
|
|
9920
9910
|
}
|
|
9921
9911
|
toString() {
|
|
9922
|
-
return "Prepare{use:" +
|
|
9912
|
+
return "Prepare{use:" + this.#use + ",cached:" + this.#cached + "}";
|
|
9923
9913
|
}
|
|
9924
9914
|
};
|
|
9925
|
-
_use = /* @__PURE__ */ new WeakMap();
|
|
9926
|
-
_cached = /* @__PURE__ */ new WeakMap();
|
|
9927
|
-
_prepare = /* @__PURE__ */ new WeakMap();
|
|
9928
9915
|
module2.exports = PrepareCacheWrapper;
|
|
9929
9916
|
}
|
|
9930
9917
|
});
|
|
9931
|
-
var require_execute = (0,
|
|
9918
|
+
var require_execute = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
9932
9919
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/cmd/execute.js"(exports, module2) {
|
|
9933
9920
|
"use strict";
|
|
9934
9921
|
var Parser = require_parser();
|
|
@@ -10223,11 +10210,11 @@ var require_execute = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
10223
10210
|
module2.exports = Execute;
|
|
10224
10211
|
}
|
|
10225
10212
|
});
|
|
10226
|
-
var require_execute_stream = (0,
|
|
10213
|
+
var require_execute_stream = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
10227
10214
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/cmd/execute-stream.js"(exports, module2) {
|
|
10228
10215
|
"use strict";
|
|
10229
10216
|
var Execute = require_execute();
|
|
10230
|
-
var { Readable } = (0,
|
|
10217
|
+
var { Readable } = (0, import_chunk_2ESYSVXG.__require)("stream");
|
|
10231
10218
|
var ExecuteStream = class extends Execute {
|
|
10232
10219
|
constructor(cmdParam, connOpts, prepare, socket) {
|
|
10233
10220
|
super(
|
|
@@ -10275,16 +10262,15 @@ var require_execute_stream = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
10275
10262
|
module2.exports = ExecuteStream;
|
|
10276
10263
|
}
|
|
10277
10264
|
});
|
|
10278
|
-
var require_prepare_result_packet = (0,
|
|
10265
|
+
var require_prepare_result_packet = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
10279
10266
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/cmd/class/prepare-result-packet.js"(exports, module2) {
|
|
10280
10267
|
"use strict";
|
|
10281
10268
|
var Errors = require_errors();
|
|
10282
10269
|
var ExecuteStream = require_execute_stream();
|
|
10283
10270
|
var Parser = require_parser();
|
|
10284
|
-
var _conn;
|
|
10285
10271
|
var PrepareResultPacket = class {
|
|
10272
|
+
#conn;
|
|
10286
10273
|
constructor(statementId, parameterCount, columns, database, sql, placeHolderIndex, conn) {
|
|
10287
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _conn);
|
|
10288
10274
|
this.id = statementId;
|
|
10289
10275
|
this.parameterCount = parameterCount;
|
|
10290
10276
|
this.columns = columns;
|
|
@@ -10292,10 +10278,10 @@ var require_prepare_result_packet = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
10292
10278
|
this.query = sql;
|
|
10293
10279
|
this.closed = false;
|
|
10294
10280
|
this._placeHolderIndex = placeHolderIndex;
|
|
10295
|
-
|
|
10281
|
+
this.#conn = conn;
|
|
10296
10282
|
}
|
|
10297
10283
|
get conn() {
|
|
10298
|
-
return
|
|
10284
|
+
return this.#conn;
|
|
10299
10285
|
}
|
|
10300
10286
|
execute(values, opts, cb, stack) {
|
|
10301
10287
|
let _opts = opts, _cb = cb;
|
|
@@ -10384,18 +10370,17 @@ var require_prepare_result_packet = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
10384
10370
|
close() {
|
|
10385
10371
|
if (!this.closed) {
|
|
10386
10372
|
this.closed = true;
|
|
10387
|
-
|
|
10373
|
+
this.#conn.emit("close_prepare", this);
|
|
10388
10374
|
}
|
|
10389
10375
|
}
|
|
10390
10376
|
toString() {
|
|
10391
10377
|
return "Prepare{closed:" + this.closed + "}";
|
|
10392
10378
|
}
|
|
10393
10379
|
};
|
|
10394
|
-
_conn = /* @__PURE__ */ new WeakMap();
|
|
10395
10380
|
module2.exports = PrepareResultPacket;
|
|
10396
10381
|
}
|
|
10397
10382
|
});
|
|
10398
|
-
var require_prepare = (0,
|
|
10383
|
+
var require_prepare = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
10399
10384
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/cmd/prepare.js"(exports, module2) {
|
|
10400
10385
|
"use strict";
|
|
10401
10386
|
var Parser = require_parser();
|
|
@@ -10545,7 +10530,7 @@ var require_prepare = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
10545
10530
|
module2.exports = Prepare;
|
|
10546
10531
|
}
|
|
10547
10532
|
});
|
|
10548
|
-
var require_close_prepare = (0,
|
|
10533
|
+
var require_close_prepare = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
10549
10534
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/cmd/close-prepare.js"(exports, module2) {
|
|
10550
10535
|
"use strict";
|
|
10551
10536
|
var Command = require_command();
|
|
@@ -10576,7 +10561,7 @@ var require_close_prepare = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
10576
10561
|
module2.exports = ClosePrepare;
|
|
10577
10562
|
}
|
|
10578
10563
|
});
|
|
10579
|
-
var require_batch_bulk = (0,
|
|
10564
|
+
var require_batch_bulk = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
10580
10565
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/cmd/batch-bulk.js"(exports, module2) {
|
|
10581
10566
|
"use strict";
|
|
10582
10567
|
var Parser = require_parser();
|
|
@@ -11010,10 +10995,10 @@ var require_batch_bulk = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
11010
10995
|
module2.exports = BatchBulk;
|
|
11011
10996
|
}
|
|
11012
10997
|
});
|
|
11013
|
-
var require_change_user = (0,
|
|
10998
|
+
var require_change_user = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
11014
10999
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/cmd/change-user.js"(exports, module2) {
|
|
11015
11000
|
"use strict";
|
|
11016
|
-
var Iconv = (0,
|
|
11001
|
+
var Iconv = (0, import_chunk_5R44VVVX.require_lib)();
|
|
11017
11002
|
var Capabilities = require_capabilities();
|
|
11018
11003
|
var Ed25519PasswordAuth = require_ed25519_password_auth();
|
|
11019
11004
|
var NativePasswordAuth = require_native_password_auth();
|
|
@@ -11137,7 +11122,7 @@ var require_change_user = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
11137
11122
|
module2.exports = ChangeUser;
|
|
11138
11123
|
}
|
|
11139
11124
|
});
|
|
11140
|
-
var require_connection_status = (0,
|
|
11125
|
+
var require_connection_status = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
11141
11126
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/const/connection_status.js"(exports, module2) {
|
|
11142
11127
|
"use strict";
|
|
11143
11128
|
var Status = {
|
|
@@ -11152,63 +11137,60 @@ var require_connection_status = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
11152
11137
|
module2.exports.Status = Status;
|
|
11153
11138
|
}
|
|
11154
11139
|
});
|
|
11155
|
-
var require_lru_prepare_cache = (0,
|
|
11140
|
+
var require_lru_prepare_cache = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
11156
11141
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/lru-prepare-cache.js"(exports, module2) {
|
|
11157
11142
|
"use strict";
|
|
11158
|
-
var LRU = (0,
|
|
11159
|
-
var _lruCache, _info;
|
|
11143
|
+
var LRU = (0, import_chunk_33LPBNDX.require_commonjs)();
|
|
11160
11144
|
var LruPrepareCache = class {
|
|
11145
|
+
#lruCache;
|
|
11146
|
+
#info;
|
|
11161
11147
|
constructor(info, prepareCacheLength) {
|
|
11162
|
-
|
|
11163
|
-
|
|
11164
|
-
(0, import_chunk_WWAWV7DQ.__privateSet)(this, _info, info);
|
|
11165
|
-
(0, import_chunk_WWAWV7DQ.__privateSet)(this, _lruCache, new LRU.LRUCache({
|
|
11148
|
+
this.#info = info;
|
|
11149
|
+
this.#lruCache = new LRU.LRUCache({
|
|
11166
11150
|
max: prepareCacheLength,
|
|
11167
11151
|
dispose: (value, key) => value.unCache()
|
|
11168
|
-
})
|
|
11152
|
+
});
|
|
11169
11153
|
}
|
|
11170
11154
|
get(sql) {
|
|
11171
|
-
const key =
|
|
11172
|
-
const cachedItem =
|
|
11155
|
+
const key = this.#info.database + "|" + sql;
|
|
11156
|
+
const cachedItem = this.#lruCache.get(key);
|
|
11173
11157
|
if (cachedItem) {
|
|
11174
11158
|
return cachedItem.incrementUse();
|
|
11175
11159
|
}
|
|
11176
11160
|
return null;
|
|
11177
11161
|
}
|
|
11178
11162
|
set(sql, cache) {
|
|
11179
|
-
const key =
|
|
11180
|
-
|
|
11163
|
+
const key = this.#info.database + "|" + sql;
|
|
11164
|
+
this.#lruCache.set(key, cache);
|
|
11181
11165
|
}
|
|
11182
11166
|
toString() {
|
|
11183
11167
|
let keyStr = "";
|
|
11184
|
-
for (const value of
|
|
11168
|
+
for (const value of this.#lruCache.keys()) {
|
|
11185
11169
|
keyStr += "[" + value + "],";
|
|
11186
11170
|
}
|
|
11187
11171
|
if (keyStr.length > 1) keyStr = keyStr.substring(0, keyStr.length - 1);
|
|
11188
11172
|
return "info{cache:" + keyStr + "}";
|
|
11189
11173
|
}
|
|
11190
11174
|
reset() {
|
|
11191
|
-
|
|
11175
|
+
this.#lruCache.clear();
|
|
11192
11176
|
}
|
|
11193
11177
|
};
|
|
11194
|
-
_lruCache = /* @__PURE__ */ new WeakMap();
|
|
11195
|
-
_info = /* @__PURE__ */ new WeakMap();
|
|
11196
11178
|
module2.exports = LruPrepareCache;
|
|
11197
11179
|
}
|
|
11198
11180
|
});
|
|
11199
|
-
var require_connection = (0,
|
|
11181
|
+
var require_connection = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
11200
11182
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/connection.js"(exports, module2) {
|
|
11201
11183
|
"use strict";
|
|
11202
|
-
var EventEmitter = (0,
|
|
11184
|
+
var EventEmitter = (0, import_chunk_2ESYSVXG.__require)("events");
|
|
11203
11185
|
var Queue = require_denque();
|
|
11204
|
-
var Net = (0,
|
|
11186
|
+
var Net = (0, import_chunk_2ESYSVXG.__require)("net");
|
|
11205
11187
|
var PacketInputStream = require_packet_input_stream();
|
|
11206
11188
|
var PacketOutputStream = require_packet_output_stream();
|
|
11207
11189
|
var CompressionInputStream = require_compression_input_stream();
|
|
11208
11190
|
var CompressionOutputStream = require_compression_output_stream();
|
|
11209
11191
|
var ServerStatus = require_server_status();
|
|
11210
11192
|
var ConnectionInformation = require_connection_information();
|
|
11211
|
-
var tls = (0,
|
|
11193
|
+
var tls = (0, import_chunk_2ESYSVXG.__require)("tls");
|
|
11212
11194
|
var Errors = require_errors();
|
|
11213
11195
|
var Utils = require_utils();
|
|
11214
11196
|
var Capabilities = require_capabilities();
|
|
@@ -11226,7 +11208,7 @@ var require_connection = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
11226
11208
|
var ChangeUser = require_change_user();
|
|
11227
11209
|
var { Status } = require_connection_status();
|
|
11228
11210
|
var LruPrepareCache = require_lru_prepare_cache();
|
|
11229
|
-
var fsPromises = (0,
|
|
11211
|
+
var fsPromises = (0, import_chunk_2ESYSVXG.__require)("fs").promises;
|
|
11230
11212
|
var Parse = require_parse();
|
|
11231
11213
|
var Collations = require_collations();
|
|
11232
11214
|
var ConnOptions = require_connection_options();
|
|
@@ -11257,20 +11239,20 @@ var require_connection = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
11257
11239
|
};
|
|
11258
11240
|
var redirectUrlFormat = /(mariadb|mysql):\/\/(([^/@:]+)?(:([^/]+))?@)?(([^/:]+)(:([0-9]+))?)(\/([^?]+)(\?(.*))?)?$/;
|
|
11259
11241
|
var Connection = class _Connection extends EventEmitter {
|
|
11242
|
+
opts;
|
|
11243
|
+
sendQueue = new Queue();
|
|
11244
|
+
receiveQueue = new Queue();
|
|
11245
|
+
waitingAuthenticationQueue = new Queue();
|
|
11246
|
+
status = Status.NOT_CONNECTED;
|
|
11247
|
+
socket = null;
|
|
11248
|
+
timeout = null;
|
|
11249
|
+
addCommand;
|
|
11250
|
+
streamOut;
|
|
11251
|
+
streamIn;
|
|
11252
|
+
info;
|
|
11253
|
+
prepareCache;
|
|
11260
11254
|
constructor(options) {
|
|
11261
11255
|
super();
|
|
11262
|
-
(0, import_chunk_WWAWV7DQ.__publicField)(this, "opts");
|
|
11263
|
-
(0, import_chunk_WWAWV7DQ.__publicField)(this, "sendQueue", new Queue());
|
|
11264
|
-
(0, import_chunk_WWAWV7DQ.__publicField)(this, "receiveQueue", new Queue());
|
|
11265
|
-
(0, import_chunk_WWAWV7DQ.__publicField)(this, "waitingAuthenticationQueue", new Queue());
|
|
11266
|
-
(0, import_chunk_WWAWV7DQ.__publicField)(this, "status", Status.NOT_CONNECTED);
|
|
11267
|
-
(0, import_chunk_WWAWV7DQ.__publicField)(this, "socket", null);
|
|
11268
|
-
(0, import_chunk_WWAWV7DQ.__publicField)(this, "timeout", null);
|
|
11269
|
-
(0, import_chunk_WWAWV7DQ.__publicField)(this, "addCommand");
|
|
11270
|
-
(0, import_chunk_WWAWV7DQ.__publicField)(this, "streamOut");
|
|
11271
|
-
(0, import_chunk_WWAWV7DQ.__publicField)(this, "streamIn");
|
|
11272
|
-
(0, import_chunk_WWAWV7DQ.__publicField)(this, "info");
|
|
11273
|
-
(0, import_chunk_WWAWV7DQ.__publicField)(this, "prepareCache");
|
|
11274
11256
|
this.opts = Object.assign(new EventEmitter(), options);
|
|
11275
11257
|
this.info = new ConnectionInformation(this.opts, this.redirect.bind(this));
|
|
11276
11258
|
this.prepareCache = this.opts.prepareCacheLength > 0 ? new LruPrepareCache(this.info, this.opts.prepareCacheLength) : null;
|
|
@@ -12787,31 +12769,28 @@ ${Utils.log(this.opts, packet.buf, packet.pos, packet.end)}`,
|
|
|
12787
12769
|
reject(err);
|
|
12788
12770
|
}
|
|
12789
12771
|
};
|
|
12790
|
-
var _collation, _socket;
|
|
12791
12772
|
var TestMethods = class {
|
|
12773
|
+
#collation;
|
|
12774
|
+
#socket;
|
|
12792
12775
|
constructor(collation, socket) {
|
|
12793
|
-
|
|
12794
|
-
|
|
12795
|
-
(0, import_chunk_WWAWV7DQ.__privateSet)(this, _collation, collation);
|
|
12796
|
-
(0, import_chunk_WWAWV7DQ.__privateSet)(this, _socket, socket);
|
|
12776
|
+
this.#collation = collation;
|
|
12777
|
+
this.#socket = socket;
|
|
12797
12778
|
}
|
|
12798
12779
|
getCollation() {
|
|
12799
|
-
return
|
|
12780
|
+
return this.#collation;
|
|
12800
12781
|
}
|
|
12801
12782
|
getSocket() {
|
|
12802
|
-
return
|
|
12783
|
+
return this.#socket;
|
|
12803
12784
|
}
|
|
12804
12785
|
};
|
|
12805
|
-
_collation = /* @__PURE__ */ new WeakMap();
|
|
12806
|
-
_socket = /* @__PURE__ */ new WeakMap();
|
|
12807
12786
|
module2.exports = Connection;
|
|
12808
12787
|
}
|
|
12809
12788
|
});
|
|
12810
|
-
var require_stream = (0,
|
|
12789
|
+
var require_stream = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
12811
12790
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/cmd/stream.js"(exports, module2) {
|
|
12812
12791
|
"use strict";
|
|
12813
12792
|
var Query = require_query();
|
|
12814
|
-
var { Readable } = (0,
|
|
12793
|
+
var { Readable } = (0, import_chunk_2ESYSVXG.__require)("stream");
|
|
12815
12794
|
var Stream = class extends Query {
|
|
12816
12795
|
constructor(cmdParam, connOpts, socket) {
|
|
12817
12796
|
super(
|
|
@@ -12858,28 +12837,27 @@ var require_stream = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
12858
12837
|
module2.exports = Stream;
|
|
12859
12838
|
}
|
|
12860
12839
|
});
|
|
12861
|
-
var require_connection_promise = (0,
|
|
12840
|
+
var require_connection_promise = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
12862
12841
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/connection-promise.js"(exports, module2) {
|
|
12863
12842
|
"use strict";
|
|
12864
12843
|
var Stream = require_stream();
|
|
12865
12844
|
var Errors = require_errors();
|
|
12866
|
-
var _conn, _capture;
|
|
12867
12845
|
var ConnectionPromise = class {
|
|
12846
|
+
#conn;
|
|
12847
|
+
#capture;
|
|
12868
12848
|
constructor(conn) {
|
|
12869
|
-
|
|
12870
|
-
|
|
12871
|
-
|
|
12872
|
-
(0, import_chunk_WWAWV7DQ.__privateSet)(this, _capture, conn.opts.trace ? Error.captureStackTrace : () => {
|
|
12873
|
-
});
|
|
12849
|
+
this.#conn = conn;
|
|
12850
|
+
this.#capture = conn.opts.trace ? Error.captureStackTrace : () => {
|
|
12851
|
+
};
|
|
12874
12852
|
}
|
|
12875
12853
|
get threadId() {
|
|
12876
|
-
return
|
|
12854
|
+
return this.#conn.threadId;
|
|
12877
12855
|
}
|
|
12878
12856
|
get info() {
|
|
12879
|
-
return
|
|
12857
|
+
return this.#conn.info;
|
|
12880
12858
|
}
|
|
12881
12859
|
get prepareCache() {
|
|
12882
|
-
return
|
|
12860
|
+
return this.#conn.prepareCache;
|
|
12883
12861
|
}
|
|
12884
12862
|
/**
|
|
12885
12863
|
* Permit to change user during connection.
|
|
@@ -12891,8 +12869,8 @@ var require_connection_promise = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
12891
12869
|
*/
|
|
12892
12870
|
changeUser(options) {
|
|
12893
12871
|
const param = { opts: options };
|
|
12894
|
-
|
|
12895
|
-
return new Promise(
|
|
12872
|
+
this.#capture(param);
|
|
12873
|
+
return new Promise(this.#conn.changeUser.bind(this.#conn, param));
|
|
12896
12874
|
}
|
|
12897
12875
|
/**
|
|
12898
12876
|
* Start transaction
|
|
@@ -12901,8 +12879,8 @@ var require_connection_promise = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
12901
12879
|
*/
|
|
12902
12880
|
beginTransaction() {
|
|
12903
12881
|
const param = { sql: "START TRANSACTION" };
|
|
12904
|
-
|
|
12905
|
-
return new Promise(
|
|
12882
|
+
this.#capture(param);
|
|
12883
|
+
return new Promise(this.#conn.query.bind(this.#conn, param));
|
|
12906
12884
|
}
|
|
12907
12885
|
/**
|
|
12908
12886
|
* Commit a transaction.
|
|
@@ -12911,8 +12889,8 @@ var require_connection_promise = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
12911
12889
|
*/
|
|
12912
12890
|
commit() {
|
|
12913
12891
|
const param = { sql: "COMMIT" };
|
|
12914
|
-
|
|
12915
|
-
return new Promise(
|
|
12892
|
+
this.#capture(param);
|
|
12893
|
+
return new Promise(this.#conn.changeTransaction.bind(this.#conn, param));
|
|
12916
12894
|
}
|
|
12917
12895
|
/**
|
|
12918
12896
|
* Roll back a transaction.
|
|
@@ -12921,8 +12899,8 @@ var require_connection_promise = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
12921
12899
|
*/
|
|
12922
12900
|
rollback() {
|
|
12923
12901
|
const param = { sql: "ROLLBACK" };
|
|
12924
|
-
|
|
12925
|
-
return new Promise(
|
|
12902
|
+
this.#capture(param);
|
|
12903
|
+
return new Promise(this.#conn.changeTransaction.bind(this.#conn, param));
|
|
12926
12904
|
}
|
|
12927
12905
|
/**
|
|
12928
12906
|
* Execute query using text protocol.
|
|
@@ -12934,8 +12912,8 @@ var require_connection_promise = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
12934
12912
|
*/
|
|
12935
12913
|
query(sql, values) {
|
|
12936
12914
|
const cmdParam = paramSetter(sql, values);
|
|
12937
|
-
|
|
12938
|
-
return new Promise(
|
|
12915
|
+
this.#capture(cmdParam);
|
|
12916
|
+
return new Promise(this.#conn.query.bind(this.#conn, cmdParam));
|
|
12939
12917
|
}
|
|
12940
12918
|
static _PARAM_DEF(sql, values) {
|
|
12941
12919
|
if (typeof sql === "object") {
|
|
@@ -12944,8 +12922,8 @@ var require_connection_promise = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
12944
12922
|
}
|
|
12945
12923
|
execute(sql, values) {
|
|
12946
12924
|
const cmdParam = paramSetter(sql, values);
|
|
12947
|
-
|
|
12948
|
-
return
|
|
12925
|
+
this.#capture(cmdParam);
|
|
12926
|
+
return this.#conn.prepareExecute(cmdParam);
|
|
12949
12927
|
}
|
|
12950
12928
|
static _EXECUTE_CMD(conn, cmdParam) {
|
|
12951
12929
|
return conn.prepareExecute(cmdParam);
|
|
@@ -12957,8 +12935,8 @@ var require_connection_promise = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
12957
12935
|
} else {
|
|
12958
12936
|
param = { sql };
|
|
12959
12937
|
}
|
|
12960
|
-
|
|
12961
|
-
return new Promise(
|
|
12938
|
+
this.#capture(param);
|
|
12939
|
+
return new Promise(this.#conn.prepare.bind(this.#conn, param));
|
|
12962
12940
|
}
|
|
12963
12941
|
/**
|
|
12964
12942
|
* Execute batch using text protocol.
|
|
@@ -12970,8 +12948,8 @@ var require_connection_promise = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
12970
12948
|
*/
|
|
12971
12949
|
batch(sql, values) {
|
|
12972
12950
|
const cmdParam = paramSetter(sql, values);
|
|
12973
|
-
|
|
12974
|
-
return
|
|
12951
|
+
this.#capture(cmdParam);
|
|
12952
|
+
return this.#conn.batch(cmdParam);
|
|
12975
12953
|
}
|
|
12976
12954
|
static _BATCH_CMD(conn, cmdParam) {
|
|
12977
12955
|
return conn.batch(cmdParam);
|
|
@@ -12987,7 +12965,7 @@ var require_connection_promise = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
12987
12965
|
Errors.createError(
|
|
12988
12966
|
"SQL file parameter is mandatory",
|
|
12989
12967
|
Errors.ER_MISSING_SQL_PARAMETER,
|
|
12990
|
-
|
|
12968
|
+
this.#conn.info,
|
|
12991
12969
|
"HY000",
|
|
12992
12970
|
null,
|
|
12993
12971
|
false,
|
|
@@ -12995,7 +12973,7 @@ var require_connection_promise = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
12995
12973
|
)
|
|
12996
12974
|
);
|
|
12997
12975
|
}
|
|
12998
|
-
return new Promise(
|
|
12976
|
+
return new Promise(this.#conn.importFile.bind(this.#conn, { file: opts.file, database: opts.database }));
|
|
12999
12977
|
}
|
|
13000
12978
|
/**
|
|
13001
12979
|
* Execute query returning a Readable Object that will emit columns/data/end/error events
|
|
@@ -13008,10 +12986,10 @@ var require_connection_promise = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
13008
12986
|
*/
|
|
13009
12987
|
queryStream(sql, values) {
|
|
13010
12988
|
const cmdParam = paramSetter(sql, values);
|
|
13011
|
-
|
|
13012
|
-
const cmd = new Stream(cmdParam,
|
|
13013
|
-
if (
|
|
13014
|
-
|
|
12989
|
+
this.#capture(cmdParam);
|
|
12990
|
+
const cmd = new Stream(cmdParam, this.#conn.opts, this.#conn.socket);
|
|
12991
|
+
if (this.#conn.opts.logger.error) cmd.on("error", this.#conn.opts.logger.error);
|
|
12992
|
+
this.#conn.addCommand(cmd, true);
|
|
13015
12993
|
return cmd.inStream;
|
|
13016
12994
|
}
|
|
13017
12995
|
/**
|
|
@@ -13023,8 +13001,8 @@ var require_connection_promise = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
13023
13001
|
const cmdParam = {
|
|
13024
13002
|
opts: { timeout }
|
|
13025
13003
|
};
|
|
13026
|
-
|
|
13027
|
-
return new Promise(
|
|
13004
|
+
this.#capture(cmdParam);
|
|
13005
|
+
return new Promise(this.#conn.ping.bind(this.#conn, cmdParam));
|
|
13028
13006
|
}
|
|
13029
13007
|
/**
|
|
13030
13008
|
* Send a reset command that will
|
|
@@ -13039,15 +13017,15 @@ var require_connection_promise = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
13039
13017
|
*/
|
|
13040
13018
|
reset() {
|
|
13041
13019
|
const cmdParam = {};
|
|
13042
|
-
|
|
13043
|
-
return new Promise(
|
|
13020
|
+
this.#capture(cmdParam);
|
|
13021
|
+
return new Promise(this.#conn.reset.bind(this.#conn, cmdParam));
|
|
13044
13022
|
}
|
|
13045
13023
|
/**
|
|
13046
13024
|
* Indicates the state of the connection as the driver knows it
|
|
13047
13025
|
* @returns {boolean}
|
|
13048
13026
|
*/
|
|
13049
13027
|
isValid() {
|
|
13050
|
-
return
|
|
13028
|
+
return this.#conn.isValid();
|
|
13051
13029
|
}
|
|
13052
13030
|
/**
|
|
13053
13031
|
* Terminate connection gracefully.
|
|
@@ -13056,8 +13034,8 @@ var require_connection_promise = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
13056
13034
|
*/
|
|
13057
13035
|
end() {
|
|
13058
13036
|
const cmdParam = {};
|
|
13059
|
-
|
|
13060
|
-
return new Promise(
|
|
13037
|
+
this.#capture(cmdParam);
|
|
13038
|
+
return new Promise(this.#conn.end.bind(this.#conn, cmdParam));
|
|
13061
13039
|
}
|
|
13062
13040
|
/**
|
|
13063
13041
|
* Alias for destroy.
|
|
@@ -13069,16 +13047,16 @@ var require_connection_promise = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
13069
13047
|
* Force connection termination by closing the underlying socket and killing server process if any.
|
|
13070
13048
|
*/
|
|
13071
13049
|
destroy() {
|
|
13072
|
-
|
|
13050
|
+
this.#conn.destroy();
|
|
13073
13051
|
}
|
|
13074
13052
|
pause() {
|
|
13075
|
-
|
|
13053
|
+
this.#conn.pause();
|
|
13076
13054
|
}
|
|
13077
13055
|
resume() {
|
|
13078
|
-
|
|
13056
|
+
this.#conn.resume();
|
|
13079
13057
|
}
|
|
13080
13058
|
format(sql, values) {
|
|
13081
|
-
|
|
13059
|
+
this.#conn.format(sql, values);
|
|
13082
13060
|
}
|
|
13083
13061
|
/**
|
|
13084
13062
|
* return current connected server version information.
|
|
@@ -13086,87 +13064,85 @@ var require_connection_promise = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
13086
13064
|
* @returns {*}
|
|
13087
13065
|
*/
|
|
13088
13066
|
serverVersion() {
|
|
13089
|
-
return
|
|
13067
|
+
return this.#conn.serverVersion();
|
|
13090
13068
|
}
|
|
13091
13069
|
/**
|
|
13092
13070
|
* Change option "debug" during connection.
|
|
13093
13071
|
* @param val debug value
|
|
13094
13072
|
*/
|
|
13095
13073
|
debug(val) {
|
|
13096
|
-
return
|
|
13074
|
+
return this.#conn.debug(val);
|
|
13097
13075
|
}
|
|
13098
13076
|
debugCompress(val) {
|
|
13099
|
-
return
|
|
13077
|
+
return this.#conn.debugCompress(val);
|
|
13100
13078
|
}
|
|
13101
13079
|
escape(val) {
|
|
13102
|
-
return
|
|
13080
|
+
return this.#conn.escape(val);
|
|
13103
13081
|
}
|
|
13104
13082
|
escapeId(val) {
|
|
13105
|
-
return
|
|
13083
|
+
return this.#conn.escapeId(val);
|
|
13106
13084
|
}
|
|
13107
13085
|
//*****************************************************************
|
|
13108
13086
|
// EventEmitter proxy methods
|
|
13109
13087
|
//*****************************************************************
|
|
13110
13088
|
on(eventName, listener) {
|
|
13111
|
-
|
|
13089
|
+
this.#conn.on.call(this.#conn, eventName, listener);
|
|
13112
13090
|
return this;
|
|
13113
13091
|
}
|
|
13114
13092
|
off(eventName, listener) {
|
|
13115
|
-
|
|
13093
|
+
this.#conn.off.call(this.#conn, eventName, listener);
|
|
13116
13094
|
return this;
|
|
13117
13095
|
}
|
|
13118
13096
|
once(eventName, listener) {
|
|
13119
|
-
|
|
13097
|
+
this.#conn.once.call(this.#conn, eventName, listener);
|
|
13120
13098
|
return this;
|
|
13121
13099
|
}
|
|
13122
13100
|
listeners(eventName) {
|
|
13123
|
-
return
|
|
13101
|
+
return this.#conn.listeners.call(this.#conn, eventName);
|
|
13124
13102
|
}
|
|
13125
13103
|
addListener(eventName, listener) {
|
|
13126
|
-
|
|
13104
|
+
this.#conn.addListener.call(this.#conn, eventName, listener);
|
|
13127
13105
|
return this;
|
|
13128
13106
|
}
|
|
13129
13107
|
eventNames() {
|
|
13130
|
-
return
|
|
13108
|
+
return this.#conn.eventNames.call(this.#conn);
|
|
13131
13109
|
}
|
|
13132
13110
|
getMaxListeners() {
|
|
13133
|
-
return
|
|
13111
|
+
return this.#conn.getMaxListeners.call(this.#conn);
|
|
13134
13112
|
}
|
|
13135
13113
|
listenerCount(eventName, listener) {
|
|
13136
|
-
return
|
|
13114
|
+
return this.#conn.listenerCount.call(this.#conn, eventName, listener);
|
|
13137
13115
|
}
|
|
13138
13116
|
prependListener(eventName, listener) {
|
|
13139
|
-
|
|
13117
|
+
this.#conn.prependListener.call(this.#conn, eventName, listener);
|
|
13140
13118
|
return this;
|
|
13141
13119
|
}
|
|
13142
13120
|
prependOnceListener(eventName, listener) {
|
|
13143
|
-
|
|
13121
|
+
this.#conn.prependOnceListener.call(this.#conn, eventName, listener);
|
|
13144
13122
|
return this;
|
|
13145
13123
|
}
|
|
13146
13124
|
removeAllListeners(eventName, listener) {
|
|
13147
|
-
|
|
13125
|
+
this.#conn.removeAllListeners.call(this.#conn, eventName, listener);
|
|
13148
13126
|
return this;
|
|
13149
13127
|
}
|
|
13150
13128
|
removeListener(eventName, listener) {
|
|
13151
|
-
|
|
13129
|
+
this.#conn.removeListener.call(this.#conn, eventName, listener);
|
|
13152
13130
|
return this;
|
|
13153
13131
|
}
|
|
13154
13132
|
setMaxListeners(n) {
|
|
13155
|
-
|
|
13133
|
+
this.#conn.setMaxListeners.call(this.#conn, n);
|
|
13156
13134
|
return this;
|
|
13157
13135
|
}
|
|
13158
13136
|
rawListeners(eventName) {
|
|
13159
|
-
return
|
|
13137
|
+
return this.#conn.rawListeners.call(this.#conn, eventName);
|
|
13160
13138
|
}
|
|
13161
13139
|
//*****************************************************************
|
|
13162
13140
|
// internal public testing methods
|
|
13163
13141
|
//*****************************************************************
|
|
13164
13142
|
get __tests() {
|
|
13165
|
-
return
|
|
13143
|
+
return this.#conn.__tests;
|
|
13166
13144
|
}
|
|
13167
13145
|
};
|
|
13168
|
-
_conn = /* @__PURE__ */ new WeakMap();
|
|
13169
|
-
_capture = /* @__PURE__ */ new WeakMap();
|
|
13170
13146
|
var paramSetter = function(sql, values) {
|
|
13171
13147
|
if (typeof sql === "object") {
|
|
13172
13148
|
return { sql: sql.sql, values: sql.values ? sql.values : values, opts: sql };
|
|
@@ -13176,30 +13152,29 @@ var require_connection_promise = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
13176
13152
|
module2.exports.paramSetter = paramSetter;
|
|
13177
13153
|
}
|
|
13178
13154
|
});
|
|
13179
|
-
var require_pool = (0,
|
|
13155
|
+
var require_pool = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
13180
13156
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/pool.js"(exports, module2) {
|
|
13181
13157
|
"use strict";
|
|
13182
|
-
var { EventEmitter } = (0,
|
|
13158
|
+
var { EventEmitter } = (0, import_chunk_2ESYSVXG.__require)("events");
|
|
13183
13159
|
var Queue = require_denque();
|
|
13184
13160
|
var Errors = require_errors();
|
|
13185
13161
|
var Utils = require_utils();
|
|
13186
13162
|
var Connection = require_connection();
|
|
13187
|
-
var _closed, _connectionInCreation, _errorCreatingConnection, _idleConnections, _activeConnections, _requests, _unusedConnectionRemoverId, _requestTimeoutId, _connErrorNumber, _initialized;
|
|
13188
13163
|
var Pool = class extends EventEmitter {
|
|
13164
|
+
opts;
|
|
13165
|
+
#closed = false;
|
|
13166
|
+
#connectionInCreation = false;
|
|
13167
|
+
#errorCreatingConnection = null;
|
|
13168
|
+
#idleConnections = new Queue();
|
|
13169
|
+
#activeConnections = {};
|
|
13170
|
+
#requests = new Queue();
|
|
13171
|
+
#unusedConnectionRemoverId;
|
|
13172
|
+
#requestTimeoutId;
|
|
13173
|
+
#connErrorNumber = 0;
|
|
13174
|
+
#initialized = false;
|
|
13175
|
+
_sizeHandlerTimeout;
|
|
13189
13176
|
constructor(options) {
|
|
13190
13177
|
super();
|
|
13191
|
-
(0, import_chunk_WWAWV7DQ.__publicField)(this, "opts");
|
|
13192
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _closed, false);
|
|
13193
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _connectionInCreation, false);
|
|
13194
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _errorCreatingConnection, null);
|
|
13195
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _idleConnections, new Queue());
|
|
13196
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _activeConnections, {});
|
|
13197
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _requests, new Queue());
|
|
13198
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _unusedConnectionRemoverId);
|
|
13199
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _requestTimeoutId);
|
|
13200
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _connErrorNumber, 0);
|
|
13201
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _initialized, false);
|
|
13202
|
-
(0, import_chunk_WWAWV7DQ.__publicField)(this, "_sizeHandlerTimeout");
|
|
13203
13178
|
this.opts = options;
|
|
13204
13179
|
this.on("_idle", this._requestsHandler);
|
|
13205
13180
|
this.on("validateSize", this._sizeHandler);
|
|
@@ -13210,7 +13185,7 @@ var require_pool = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
13210
13185
|
//*****************************************************************
|
|
13211
13186
|
_doCreateConnection(resolve, reject, timeoutEnd) {
|
|
13212
13187
|
this._createConnection(timeoutEnd).then((conn) => {
|
|
13213
|
-
if (
|
|
13188
|
+
if (this.#closed) {
|
|
13214
13189
|
conn.forceEnd(
|
|
13215
13190
|
null,
|
|
13216
13191
|
() => {
|
|
@@ -13231,7 +13206,7 @@ var require_pool = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
13231
13206
|
const pool = this;
|
|
13232
13207
|
conn.destroy = function() {
|
|
13233
13208
|
pool._endLeak(conn);
|
|
13234
|
-
delete
|
|
13209
|
+
delete pool.#activeConnections[conn.threadId];
|
|
13235
13210
|
nativeDestroy();
|
|
13236
13211
|
pool.emit("validateSize");
|
|
13237
13212
|
};
|
|
@@ -13239,23 +13214,23 @@ var require_pool = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
13239
13214
|
let idx = 0;
|
|
13240
13215
|
let currConn;
|
|
13241
13216
|
pool._endLeak(conn);
|
|
13242
|
-
delete
|
|
13243
|
-
while (currConn =
|
|
13217
|
+
delete pool.#activeConnections[conn.threadId];
|
|
13218
|
+
while (currConn = pool.#idleConnections.peekAt(idx)) {
|
|
13244
13219
|
if (currConn === conn) {
|
|
13245
|
-
|
|
13220
|
+
pool.#idleConnections.removeOne(idx);
|
|
13246
13221
|
continue;
|
|
13247
13222
|
}
|
|
13248
13223
|
currConn.lastUse = Math.min(currConn.lastUse, Date.now() - pool.opts.minDelayValidation);
|
|
13249
13224
|
idx++;
|
|
13250
13225
|
}
|
|
13251
13226
|
setTimeout(() => {
|
|
13252
|
-
if (!
|
|
13227
|
+
if (!pool.#requests.isEmpty()) {
|
|
13253
13228
|
pool._sizeHandler();
|
|
13254
13229
|
}
|
|
13255
13230
|
}, 0);
|
|
13256
13231
|
});
|
|
13257
|
-
|
|
13258
|
-
|
|
13232
|
+
this.#idleConnections.push(conn);
|
|
13233
|
+
this.#connectionInCreation = false;
|
|
13259
13234
|
this.emit("_idle");
|
|
13260
13235
|
this.emit("connection", conn);
|
|
13261
13236
|
resolve(conn);
|
|
@@ -13263,7 +13238,7 @@ var require_pool = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
13263
13238
|
if (err instanceof AggregateError) {
|
|
13264
13239
|
err = err.errors[0];
|
|
13265
13240
|
}
|
|
13266
|
-
if (
|
|
13241
|
+
if (this.#closed || err.errno && (err.errno === 1524 || err.errno === 1045 || err.errno === 1698) || timeoutEnd < Date.now()) {
|
|
13267
13242
|
err.message = err.message + this._errorMsgAddon();
|
|
13268
13243
|
reject(err);
|
|
13269
13244
|
return;
|
|
@@ -13273,7 +13248,7 @@ var require_pool = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
13273
13248
|
}
|
|
13274
13249
|
_destroy(conn) {
|
|
13275
13250
|
this._endLeak(conn);
|
|
13276
|
-
delete
|
|
13251
|
+
delete this.#activeConnections[conn.threadId];
|
|
13277
13252
|
conn.lastUse = Date.now();
|
|
13278
13253
|
conn.forceEnd(
|
|
13279
13254
|
null,
|
|
@@ -13288,11 +13263,11 @@ var require_pool = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
13288
13263
|
this.emit("validateSize");
|
|
13289
13264
|
}
|
|
13290
13265
|
release(conn) {
|
|
13291
|
-
if (
|
|
13266
|
+
if (this.#activeConnections[conn.threadId]) {
|
|
13292
13267
|
this._endLeak(conn);
|
|
13293
|
-
|
|
13268
|
+
this.#activeConnections[conn.threadId] = null;
|
|
13294
13269
|
conn.lastUse = Date.now();
|
|
13295
|
-
if (
|
|
13270
|
+
if (this.#closed) {
|
|
13296
13271
|
conn.forceEnd(
|
|
13297
13272
|
null,
|
|
13298
13273
|
() => {
|
|
@@ -13302,7 +13277,7 @@ var require_pool = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
13302
13277
|
);
|
|
13303
13278
|
} else if (conn.isValid()) {
|
|
13304
13279
|
this.emit("release", conn);
|
|
13305
|
-
|
|
13280
|
+
this.#idleConnections.push(conn);
|
|
13306
13281
|
process.nextTick(this.emit.bind(this, "_idle"));
|
|
13307
13282
|
} else {
|
|
13308
13283
|
this.emit("validateSize");
|
|
@@ -13338,23 +13313,23 @@ var require_pool = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
13338
13313
|
* Permit to remove idle connection if unused for some time.
|
|
13339
13314
|
*/
|
|
13340
13315
|
_startReaping() {
|
|
13341
|
-
if (!
|
|
13342
|
-
|
|
13316
|
+
if (!this.#unusedConnectionRemoverId && this.opts.idleTimeout > 0) {
|
|
13317
|
+
this.#unusedConnectionRemoverId = setInterval(this._reaper.bind(this), 500);
|
|
13343
13318
|
}
|
|
13344
13319
|
}
|
|
13345
13320
|
_stopReaping() {
|
|
13346
|
-
if (
|
|
13347
|
-
clearInterval(
|
|
13321
|
+
if (this.#unusedConnectionRemoverId && this.totalConnections() === 0) {
|
|
13322
|
+
clearInterval(this.#unusedConnectionRemoverId);
|
|
13348
13323
|
}
|
|
13349
13324
|
}
|
|
13350
13325
|
_reaper() {
|
|
13351
13326
|
const idleTimeRemoval = Date.now() - this.opts.idleTimeout * 1e3;
|
|
13352
|
-
let maxRemoval = Math.max(0,
|
|
13327
|
+
let maxRemoval = Math.max(0, this.#idleConnections.length - this.opts.minimumIdle);
|
|
13353
13328
|
while (maxRemoval > 0) {
|
|
13354
|
-
const conn =
|
|
13329
|
+
const conn = this.#idleConnections.peek();
|
|
13355
13330
|
maxRemoval--;
|
|
13356
13331
|
if (conn && conn.lastUse < idleTimeRemoval) {
|
|
13357
|
-
|
|
13332
|
+
this.#idleConnections.shift();
|
|
13358
13333
|
conn.forceEnd(
|
|
13359
13334
|
null,
|
|
13360
13335
|
() => {
|
|
@@ -13372,45 +13347,45 @@ var require_pool = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
13372
13347
|
this.emit("validateSize");
|
|
13373
13348
|
}
|
|
13374
13349
|
_shouldCreateMoreConnections() {
|
|
13375
|
-
return !
|
|
13350
|
+
return !this.#connectionInCreation && this.#idleConnections.length < this.opts.minimumIdle && this.totalConnections() < this.opts.connectionLimit && !this.#closed;
|
|
13376
13351
|
}
|
|
13377
13352
|
/**
|
|
13378
13353
|
* Grow pool connections until reaching connection limit.
|
|
13379
13354
|
*/
|
|
13380
13355
|
_sizeHandler() {
|
|
13381
13356
|
if (this._shouldCreateMoreConnections() && !this._sizeHandlerTimeout) {
|
|
13382
|
-
|
|
13357
|
+
this.#connectionInCreation = true;
|
|
13383
13358
|
setImmediate(
|
|
13384
13359
|
function() {
|
|
13385
13360
|
const timeoutEnd = Date.now() + this.opts.initializationTimeout;
|
|
13386
13361
|
new Promise((resolve, reject) => {
|
|
13387
13362
|
this._doCreateConnection(resolve, reject, timeoutEnd);
|
|
13388
13363
|
}).then(() => {
|
|
13389
|
-
|
|
13390
|
-
|
|
13391
|
-
|
|
13364
|
+
this.#initialized = true;
|
|
13365
|
+
this.#errorCreatingConnection = null;
|
|
13366
|
+
this.#connErrorNumber = 0;
|
|
13392
13367
|
if (this._shouldCreateMoreConnections()) {
|
|
13393
13368
|
this.emit("validateSize");
|
|
13394
13369
|
}
|
|
13395
13370
|
this._startReaping();
|
|
13396
13371
|
}).catch((err) => {
|
|
13397
|
-
|
|
13398
|
-
if (!
|
|
13399
|
-
if (!
|
|
13372
|
+
this.#connectionInCreation = false;
|
|
13373
|
+
if (!this.#closed) {
|
|
13374
|
+
if (!this.#initialized) {
|
|
13400
13375
|
err.message = "Error during pool initialization: " + err.message;
|
|
13401
13376
|
} else {
|
|
13402
13377
|
err.message = "Pool fails to create connection: " + err.message;
|
|
13403
13378
|
}
|
|
13404
|
-
|
|
13379
|
+
this.#errorCreatingConnection = err;
|
|
13405
13380
|
this.emit("error", err);
|
|
13406
13381
|
this._sizeHandlerTimeout = setTimeout(
|
|
13407
13382
|
function() {
|
|
13408
13383
|
this._sizeHandlerTimeout = null;
|
|
13409
|
-
if (!
|
|
13384
|
+
if (!this.#requests.isEmpty()) {
|
|
13410
13385
|
this._sizeHandler();
|
|
13411
13386
|
}
|
|
13412
13387
|
}.bind(this),
|
|
13413
|
-
Math.min(++
|
|
13388
|
+
Math.min(++this.#connErrorNumber * 500, 1e4)
|
|
13414
13389
|
);
|
|
13415
13390
|
}
|
|
13416
13391
|
});
|
|
@@ -13422,24 +13397,24 @@ var require_pool = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
13422
13397
|
* Launch next waiting task request if available connections.
|
|
13423
13398
|
*/
|
|
13424
13399
|
_requestsHandler() {
|
|
13425
|
-
clearTimeout(
|
|
13426
|
-
|
|
13427
|
-
const request =
|
|
13400
|
+
clearTimeout(this.#requestTimeoutId);
|
|
13401
|
+
this.#requestTimeoutId = null;
|
|
13402
|
+
const request = this.#requests.shift();
|
|
13428
13403
|
if (request) {
|
|
13429
|
-
const conn =
|
|
13404
|
+
const conn = this.#idleConnections.shift();
|
|
13430
13405
|
if (conn) {
|
|
13431
13406
|
if (this.opts.leakDetectionTimeout > 0) this._checkLeak(conn);
|
|
13432
13407
|
this.emit("acquire", conn);
|
|
13433
|
-
|
|
13408
|
+
this.#activeConnections[conn.threadId] = conn;
|
|
13434
13409
|
request.resolver(conn);
|
|
13435
13410
|
} else {
|
|
13436
|
-
|
|
13411
|
+
this.#requests.unshift(request);
|
|
13437
13412
|
}
|
|
13438
13413
|
this._requestTimeoutHandler();
|
|
13439
13414
|
}
|
|
13440
13415
|
}
|
|
13441
13416
|
_hasIdleConnection() {
|
|
13442
|
-
return !
|
|
13417
|
+
return !this.#idleConnections.isEmpty();
|
|
13443
13418
|
}
|
|
13444
13419
|
/**
|
|
13445
13420
|
* Return an idle Connection.
|
|
@@ -13448,12 +13423,12 @@ var require_pool = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
13448
13423
|
* @returns {Promise<Connection>} connection of null of no valid idle connection.
|
|
13449
13424
|
*/
|
|
13450
13425
|
async _doAcquire() {
|
|
13451
|
-
if (!this._hasIdleConnection() ||
|
|
13426
|
+
if (!this._hasIdleConnection() || this.#closed) return Promise.reject();
|
|
13452
13427
|
let conn;
|
|
13453
13428
|
let mustRecheckSize = false;
|
|
13454
|
-
while ((conn =
|
|
13429
|
+
while ((conn = this.#idleConnections.shift()) != null) {
|
|
13455
13430
|
if (conn.isValid()) {
|
|
13456
|
-
|
|
13431
|
+
this.#activeConnections[conn.threadId] = conn;
|
|
13457
13432
|
if (this.opts.minDelayValidation <= 0 || Date.now() - conn.lastUse > this.opts.minDelayValidation) {
|
|
13458
13433
|
try {
|
|
13459
13434
|
const cmdParam = {
|
|
@@ -13461,7 +13436,7 @@ var require_pool = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
13461
13436
|
};
|
|
13462
13437
|
await new Promise(conn.ping.bind(conn, cmdParam));
|
|
13463
13438
|
} catch (e) {
|
|
13464
|
-
delete
|
|
13439
|
+
delete this.#activeConnections[conn.threadId];
|
|
13465
13440
|
continue;
|
|
13466
13441
|
}
|
|
13467
13442
|
}
|
|
@@ -13475,13 +13450,13 @@ var require_pool = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
13475
13450
|
return Promise.reject();
|
|
13476
13451
|
}
|
|
13477
13452
|
_requestTimeoutHandler() {
|
|
13478
|
-
|
|
13453
|
+
this.#requestTimeoutId = null;
|
|
13479
13454
|
const currTime = Date.now();
|
|
13480
13455
|
let request;
|
|
13481
|
-
while (request =
|
|
13456
|
+
while (request = this.#requests.peekFront()) {
|
|
13482
13457
|
if (request.timeout <= currTime) {
|
|
13483
|
-
|
|
13484
|
-
let cause = this.activeConnections() === 0 ?
|
|
13458
|
+
this.#requests.shift();
|
|
13459
|
+
let cause = this.activeConnections() === 0 ? this.#errorCreatingConnection : null;
|
|
13485
13460
|
let err = Errors.createError(
|
|
13486
13461
|
`retrieve connection from pool timeout after ${Math.abs(
|
|
13487
13462
|
Date.now() - (request.timeout - this.opts.acquireTimeout)
|
|
@@ -13497,7 +13472,7 @@ var require_pool = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
13497
13472
|
);
|
|
13498
13473
|
request.reject(err);
|
|
13499
13474
|
} else {
|
|
13500
|
-
|
|
13475
|
+
this.#requestTimeoutId = setTimeout(this._requestTimeoutHandler.bind(this), request.timeout - currTime);
|
|
13501
13476
|
return;
|
|
13502
13477
|
}
|
|
13503
13478
|
}
|
|
@@ -13508,10 +13483,10 @@ var require_pool = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
13508
13483
|
*/
|
|
13509
13484
|
_searchInfo() {
|
|
13510
13485
|
let info = null;
|
|
13511
|
-
let conn =
|
|
13486
|
+
let conn = this.#idleConnections.get(0);
|
|
13512
13487
|
if (!conn) {
|
|
13513
|
-
for (const threadId in Object.keys(
|
|
13514
|
-
conn =
|
|
13488
|
+
for (const threadId in Object.keys(this.#activeConnections)) {
|
|
13489
|
+
conn = this.#activeConnections[threadId];
|
|
13515
13490
|
if (!conn) {
|
|
13516
13491
|
break;
|
|
13517
13492
|
}
|
|
@@ -13530,7 +13505,7 @@ var require_pool = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
13530
13505
|
const pool = this;
|
|
13531
13506
|
conn.forceEnd = conn.end;
|
|
13532
13507
|
conn.release = function(resolve) {
|
|
13533
|
-
if (
|
|
13508
|
+
if (pool.#closed || !conn.isValid()) {
|
|
13534
13509
|
pool._destroy(conn);
|
|
13535
13510
|
resolve();
|
|
13536
13511
|
return;
|
|
@@ -13551,7 +13526,7 @@ var require_pool = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
13551
13526
|
}
|
|
13552
13527
|
_leakedConnections() {
|
|
13553
13528
|
let counter = 0;
|
|
13554
|
-
for (const connection of Object.values(
|
|
13529
|
+
for (const connection of Object.values(this.#activeConnections)) {
|
|
13555
13530
|
if (connection && connection.leaked) counter++;
|
|
13556
13531
|
}
|
|
13557
13532
|
return counter;
|
|
@@ -13571,7 +13546,7 @@ var require_pool = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
13571
13546
|
// public methods
|
|
13572
13547
|
//*****************************************************************
|
|
13573
13548
|
get closed() {
|
|
13574
|
-
return
|
|
13549
|
+
return this.#closed;
|
|
13575
13550
|
}
|
|
13576
13551
|
/**
|
|
13577
13552
|
* Get current total connection number.
|
|
@@ -13586,7 +13561,7 @@ var require_pool = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
13586
13561
|
*/
|
|
13587
13562
|
activeConnections() {
|
|
13588
13563
|
let counter = 0;
|
|
13589
|
-
for (const connection of Object.values(
|
|
13564
|
+
for (const connection of Object.values(this.#activeConnections)) {
|
|
13590
13565
|
if (connection) counter++;
|
|
13591
13566
|
}
|
|
13592
13567
|
return counter;
|
|
@@ -13596,14 +13571,14 @@ var require_pool = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
13596
13571
|
* @return {number}
|
|
13597
13572
|
*/
|
|
13598
13573
|
idleConnections() {
|
|
13599
|
-
return
|
|
13574
|
+
return this.#idleConnections.length;
|
|
13600
13575
|
}
|
|
13601
13576
|
/**
|
|
13602
13577
|
* Get current stacked connection request.
|
|
13603
13578
|
* @return {number}
|
|
13604
13579
|
*/
|
|
13605
13580
|
taskQueueSize() {
|
|
13606
|
-
return
|
|
13581
|
+
return this.#requests.length;
|
|
13607
13582
|
}
|
|
13608
13583
|
escape(value) {
|
|
13609
13584
|
return Utils.escape(this.opts.connOptions, this._searchInfo(), value);
|
|
@@ -13622,7 +13597,7 @@ var require_pool = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
13622
13597
|
* @return {Promise}
|
|
13623
13598
|
*/
|
|
13624
13599
|
getConnection(cmdParam) {
|
|
13625
|
-
if (
|
|
13600
|
+
if (this.#closed) {
|
|
13626
13601
|
return Promise.reject(
|
|
13627
13602
|
Errors.createError(
|
|
13628
13603
|
"pool is closed",
|
|
@@ -13641,7 +13616,7 @@ var require_pool = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
13641
13616
|
return conn;
|
|
13642
13617
|
},
|
|
13643
13618
|
() => {
|
|
13644
|
-
if (
|
|
13619
|
+
if (this.#closed) {
|
|
13645
13620
|
throw Errors.createError(
|
|
13646
13621
|
"Cannot add request to pool, pool is closed",
|
|
13647
13622
|
Errors.ER_POOL_ALREADY_CLOSED,
|
|
@@ -13657,9 +13632,9 @@ var require_pool = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
13657
13632
|
function(resolver, rejecter) {
|
|
13658
13633
|
setImmediate(this.emit.bind(this, "enqueue"));
|
|
13659
13634
|
const request = new Request(Date.now() + this.opts.acquireTimeout, cmdParam.stack, resolver, rejecter);
|
|
13660
|
-
|
|
13661
|
-
if (!
|
|
13662
|
-
|
|
13635
|
+
this.#requests.push(request);
|
|
13636
|
+
if (!this.#requestTimeoutId) {
|
|
13637
|
+
this.#requestTimeoutId = setTimeout(this._requestTimeoutHandler.bind(this), this.opts.acquireTimeout);
|
|
13663
13638
|
}
|
|
13664
13639
|
}.bind(this)
|
|
13665
13640
|
);
|
|
@@ -13677,22 +13652,22 @@ var require_pool = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
13677
13652
|
* @return Promise
|
|
13678
13653
|
*/
|
|
13679
13654
|
end() {
|
|
13680
|
-
if (
|
|
13655
|
+
if (this.#closed) {
|
|
13681
13656
|
return Promise.reject(Errors.createError("pool is already closed", Errors.ER_POOL_ALREADY_CLOSED));
|
|
13682
13657
|
}
|
|
13683
|
-
|
|
13684
|
-
clearInterval(
|
|
13658
|
+
this.#closed = true;
|
|
13659
|
+
clearInterval(this.#unusedConnectionRemoverId);
|
|
13685
13660
|
clearInterval(this._sizeHandlerTimeout);
|
|
13686
13661
|
const cmdParam = {};
|
|
13687
13662
|
if (this.opts.trace) Error.captureStackTrace(cmdParam);
|
|
13688
13663
|
const idleConnectionsEndings = [];
|
|
13689
13664
|
let conn;
|
|
13690
|
-
while (conn =
|
|
13665
|
+
while (conn = this.#idleConnections.shift()) {
|
|
13691
13666
|
idleConnectionsEndings.push(new Promise(conn.forceEnd.bind(conn, cmdParam)));
|
|
13692
13667
|
}
|
|
13693
|
-
clearTimeout(
|
|
13694
|
-
|
|
13695
|
-
if (!
|
|
13668
|
+
clearTimeout(this.#requestTimeoutId);
|
|
13669
|
+
this.#requestTimeoutId = null;
|
|
13670
|
+
if (!this.#requests.isEmpty()) {
|
|
13696
13671
|
const err = Errors.createError(
|
|
13697
13672
|
"pool is ending, connection request aborted",
|
|
13698
13673
|
Errors.ER_CLOSING_POOL,
|
|
@@ -13703,7 +13678,7 @@ var require_pool = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
13703
13678
|
cmdParam.stack
|
|
13704
13679
|
);
|
|
13705
13680
|
let task;
|
|
13706
|
-
while (task =
|
|
13681
|
+
while (task = this.#requests.shift()) {
|
|
13707
13682
|
task.reject(err);
|
|
13708
13683
|
}
|
|
13709
13684
|
}
|
|
@@ -13716,7 +13691,7 @@ var require_pool = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
13716
13691
|
await new Promise((res) => setTimeout(() => res(), 100));
|
|
13717
13692
|
}
|
|
13718
13693
|
}
|
|
13719
|
-
for (const connection of Object.values(
|
|
13694
|
+
for (const connection of Object.values(pool.#activeConnections)) {
|
|
13720
13695
|
if (connection) connection.destroy();
|
|
13721
13696
|
}
|
|
13722
13697
|
}
|
|
@@ -13724,16 +13699,6 @@ var require_pool = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
13724
13699
|
});
|
|
13725
13700
|
}
|
|
13726
13701
|
};
|
|
13727
|
-
_closed = /* @__PURE__ */ new WeakMap();
|
|
13728
|
-
_connectionInCreation = /* @__PURE__ */ new WeakMap();
|
|
13729
|
-
_errorCreatingConnection = /* @__PURE__ */ new WeakMap();
|
|
13730
|
-
_idleConnections = /* @__PURE__ */ new WeakMap();
|
|
13731
|
-
_activeConnections = /* @__PURE__ */ new WeakMap();
|
|
13732
|
-
_requests = /* @__PURE__ */ new WeakMap();
|
|
13733
|
-
_unusedConnectionRemoverId = /* @__PURE__ */ new WeakMap();
|
|
13734
|
-
_requestTimeoutId = /* @__PURE__ */ new WeakMap();
|
|
13735
|
-
_connErrorNumber = /* @__PURE__ */ new WeakMap();
|
|
13736
|
-
_initialized = /* @__PURE__ */ new WeakMap();
|
|
13737
13702
|
var Request = class {
|
|
13738
13703
|
constructor(timeout, stack, resolver, rejecter) {
|
|
13739
13704
|
this.timeout = timeout;
|
|
@@ -13748,61 +13713,60 @@ var require_pool = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
13748
13713
|
module2.exports = Pool;
|
|
13749
13714
|
}
|
|
13750
13715
|
});
|
|
13751
|
-
var require_pool_promise = (0,
|
|
13716
|
+
var require_pool_promise = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
13752
13717
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/pool-promise.js"(exports, module2) {
|
|
13753
13718
|
"use strict";
|
|
13754
|
-
var { EventEmitter } = (0,
|
|
13719
|
+
var { EventEmitter } = (0, import_chunk_2ESYSVXG.__require)("events");
|
|
13755
13720
|
var Pool = require_pool();
|
|
13756
13721
|
var ConnectionPromise = require_connection_promise();
|
|
13757
13722
|
var Errors = require_errors();
|
|
13758
|
-
var _pool;
|
|
13759
13723
|
var PoolPromise = class extends EventEmitter {
|
|
13724
|
+
#pool;
|
|
13760
13725
|
constructor(options) {
|
|
13761
13726
|
super();
|
|
13762
|
-
|
|
13763
|
-
(
|
|
13764
|
-
|
|
13765
|
-
|
|
13766
|
-
|
|
13767
|
-
|
|
13768
|
-
(0, import_chunk_WWAWV7DQ.__privateGet)(this, _pool).on("error", this.emit.bind(this, "error"));
|
|
13727
|
+
this.#pool = new Pool(options);
|
|
13728
|
+
this.#pool.on("acquire", this.emit.bind(this, "acquire"));
|
|
13729
|
+
this.#pool.on("connection", this.emit.bind(this, "connection"));
|
|
13730
|
+
this.#pool.on("enqueue", this.emit.bind(this, "enqueue"));
|
|
13731
|
+
this.#pool.on("release", this.emit.bind(this, "release"));
|
|
13732
|
+
this.#pool.on("error", this.emit.bind(this, "error"));
|
|
13769
13733
|
}
|
|
13770
13734
|
get closed() {
|
|
13771
|
-
return
|
|
13735
|
+
return this.#pool.closed;
|
|
13772
13736
|
}
|
|
13773
13737
|
/**
|
|
13774
13738
|
* Get current total connection number.
|
|
13775
13739
|
* @return {number}
|
|
13776
13740
|
*/
|
|
13777
13741
|
totalConnections() {
|
|
13778
|
-
return
|
|
13742
|
+
return this.#pool.totalConnections();
|
|
13779
13743
|
}
|
|
13780
13744
|
/**
|
|
13781
13745
|
* Get current active connections.
|
|
13782
13746
|
* @return {number}
|
|
13783
13747
|
*/
|
|
13784
13748
|
activeConnections() {
|
|
13785
|
-
return
|
|
13749
|
+
return this.#pool.activeConnections();
|
|
13786
13750
|
}
|
|
13787
13751
|
/**
|
|
13788
13752
|
* Get current idle connection number.
|
|
13789
13753
|
* @return {number}
|
|
13790
13754
|
*/
|
|
13791
13755
|
idleConnections() {
|
|
13792
|
-
return
|
|
13756
|
+
return this.#pool.idleConnections();
|
|
13793
13757
|
}
|
|
13794
13758
|
/**
|
|
13795
13759
|
* Get current stacked connection request.
|
|
13796
13760
|
* @return {number}
|
|
13797
13761
|
*/
|
|
13798
13762
|
taskQueueSize() {
|
|
13799
|
-
return
|
|
13763
|
+
return this.#pool.taskQueueSize();
|
|
13800
13764
|
}
|
|
13801
13765
|
escape(value) {
|
|
13802
|
-
return
|
|
13766
|
+
return this.#pool.escape(value);
|
|
13803
13767
|
}
|
|
13804
13768
|
escapeId(value) {
|
|
13805
|
-
return
|
|
13769
|
+
return this.#pool.escapeId(value);
|
|
13806
13770
|
}
|
|
13807
13771
|
/**
|
|
13808
13772
|
* Ends pool
|
|
@@ -13810,7 +13774,7 @@ var require_pool_promise = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
13810
13774
|
* @return Promise
|
|
13811
13775
|
**/
|
|
13812
13776
|
end() {
|
|
13813
|
-
return
|
|
13777
|
+
return this.#pool.end();
|
|
13814
13778
|
}
|
|
13815
13779
|
/**
|
|
13816
13780
|
* Retrieve a connection from pool.
|
|
@@ -13820,8 +13784,8 @@ var require_pool_promise = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
13820
13784
|
*/
|
|
13821
13785
|
async getConnection() {
|
|
13822
13786
|
const cmdParam = {};
|
|
13823
|
-
if (
|
|
13824
|
-
const baseConn = await
|
|
13787
|
+
if (this.#pool.opts.connOptions.trace) Error.captureStackTrace(cmdParam);
|
|
13788
|
+
const baseConn = await this.#pool.getConnection(cmdParam);
|
|
13825
13789
|
const conn = new ConnectionPromise(baseConn);
|
|
13826
13790
|
conn.release = () => new Promise(baseConn.release);
|
|
13827
13791
|
conn.end = conn.release;
|
|
@@ -13838,10 +13802,10 @@ var require_pool_promise = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
13838
13802
|
*/
|
|
13839
13803
|
query(sql, values) {
|
|
13840
13804
|
const cmdParam = ConnectionPromise.paramSetter(sql, values);
|
|
13841
|
-
if (
|
|
13842
|
-
return
|
|
13805
|
+
if (this.#pool.opts.connOptions.trace) Error.captureStackTrace(cmdParam);
|
|
13806
|
+
return this.#pool.getConnection(cmdParam).then((baseConn) => {
|
|
13843
13807
|
return new Promise(baseConn.query.bind(baseConn, cmdParam)).finally(() => {
|
|
13844
|
-
|
|
13808
|
+
this.#pool.release(baseConn);
|
|
13845
13809
|
});
|
|
13846
13810
|
});
|
|
13847
13811
|
}
|
|
@@ -13855,10 +13819,10 @@ var require_pool_promise = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
13855
13819
|
*/
|
|
13856
13820
|
execute(sql, values) {
|
|
13857
13821
|
const cmdParam = ConnectionPromise.paramSetter(sql, values);
|
|
13858
|
-
if (
|
|
13859
|
-
return
|
|
13822
|
+
if (this.#pool.opts.connOptions.trace) Error.captureStackTrace(cmdParam);
|
|
13823
|
+
return this.#pool.getConnection(cmdParam).then((baseConn) => {
|
|
13860
13824
|
return ConnectionPromise._EXECUTE_CMD(baseConn, cmdParam).finally(() => {
|
|
13861
|
-
|
|
13825
|
+
this.#pool.release(baseConn);
|
|
13862
13826
|
});
|
|
13863
13827
|
});
|
|
13864
13828
|
}
|
|
@@ -13871,10 +13835,10 @@ var require_pool_promise = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
13871
13835
|
*/
|
|
13872
13836
|
batch(sql, values) {
|
|
13873
13837
|
const cmdParam = ConnectionPromise.paramSetter(sql, values);
|
|
13874
|
-
if (
|
|
13875
|
-
return
|
|
13838
|
+
if (this.#pool.opts.connOptions.trace) Error.captureStackTrace(cmdParam);
|
|
13839
|
+
return this.#pool.getConnection(cmdParam).then((baseConn) => {
|
|
13876
13840
|
return ConnectionPromise._BATCH_CMD(baseConn, cmdParam).finally(() => {
|
|
13877
|
-
|
|
13841
|
+
this.#pool.release(baseConn);
|
|
13878
13842
|
});
|
|
13879
13843
|
});
|
|
13880
13844
|
}
|
|
@@ -13897,23 +13861,22 @@ var require_pool_promise = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
13897
13861
|
)
|
|
13898
13862
|
);
|
|
13899
13863
|
}
|
|
13900
|
-
return
|
|
13864
|
+
return this.#pool.getConnection({}).then((baseConn) => {
|
|
13901
13865
|
return new Promise(baseConn.importFile.bind(baseConn, { file: opts.file, database: opts.database })).finally(
|
|
13902
13866
|
() => {
|
|
13903
|
-
|
|
13867
|
+
this.#pool.release(baseConn);
|
|
13904
13868
|
}
|
|
13905
13869
|
);
|
|
13906
13870
|
});
|
|
13907
13871
|
}
|
|
13908
13872
|
toString() {
|
|
13909
|
-
return "poolPromise(" +
|
|
13873
|
+
return "poolPromise(" + this.#pool.toString() + ")";
|
|
13910
13874
|
}
|
|
13911
13875
|
};
|
|
13912
|
-
_pool = /* @__PURE__ */ new WeakMap();
|
|
13913
13876
|
module2.exports = PoolPromise;
|
|
13914
13877
|
}
|
|
13915
13878
|
});
|
|
13916
|
-
var require_cluster_options = (0,
|
|
13879
|
+
var require_cluster_options = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
13917
13880
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/config/cluster-options.js"(exports, module2) {
|
|
13918
13881
|
"use strict";
|
|
13919
13882
|
var ClusterOptions = class {
|
|
@@ -13934,7 +13897,7 @@ var require_cluster_options = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
13934
13897
|
module2.exports = ClusterOptions;
|
|
13935
13898
|
}
|
|
13936
13899
|
});
|
|
13937
|
-
var require_pool_options = (0,
|
|
13900
|
+
var require_pool_options = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
13938
13901
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/config/pool-options.js"(exports, module2) {
|
|
13939
13902
|
"use strict";
|
|
13940
13903
|
var ConnOptions = require_connection_options();
|
|
@@ -13972,31 +13935,30 @@ var require_pool_options = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
13972
13935
|
module2.exports = PoolOptions;
|
|
13973
13936
|
}
|
|
13974
13937
|
});
|
|
13975
|
-
var require_connection_callback = (0,
|
|
13938
|
+
var require_connection_callback = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
13976
13939
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/connection-callback.js"(exports, module2) {
|
|
13977
13940
|
"use strict";
|
|
13978
13941
|
var Errors = require_errors();
|
|
13979
13942
|
var { Status } = require_connection_status();
|
|
13980
13943
|
var Query = require_query();
|
|
13981
|
-
var
|
|
13982
|
-
|
|
13944
|
+
var ConnectionCallback = class _ConnectionCallback {
|
|
13945
|
+
#conn;
|
|
13983
13946
|
constructor(conn) {
|
|
13984
|
-
|
|
13985
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _noop, () => {
|
|
13986
|
-
});
|
|
13987
|
-
(0, import_chunk_WWAWV7DQ.__publicField)(this, "release", (cb) => {
|
|
13988
|
-
(0, import_chunk_WWAWV7DQ.__privateGet)(this, _conn).release(() => {
|
|
13989
|
-
if (cb) cb();
|
|
13990
|
-
});
|
|
13991
|
-
});
|
|
13992
|
-
(0, import_chunk_WWAWV7DQ.__privateSet)(this, _conn, conn);
|
|
13947
|
+
this.#conn = conn;
|
|
13993
13948
|
}
|
|
13994
13949
|
get threadId() {
|
|
13995
|
-
return
|
|
13950
|
+
return this.#conn.info ? this.#conn.info.threadId : null;
|
|
13996
13951
|
}
|
|
13997
13952
|
get info() {
|
|
13998
|
-
return
|
|
13953
|
+
return this.#conn.info;
|
|
13999
13954
|
}
|
|
13955
|
+
#noop = () => {
|
|
13956
|
+
};
|
|
13957
|
+
release = (cb) => {
|
|
13958
|
+
this.#conn.release(() => {
|
|
13959
|
+
if (cb) cb();
|
|
13960
|
+
});
|
|
13961
|
+
};
|
|
14000
13962
|
/**
|
|
14001
13963
|
* Permit to change user during connection.
|
|
14002
13964
|
* All user variables will be reset, Prepare commands will be released.
|
|
@@ -14018,10 +13980,10 @@ var require_connection_callback = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
14018
13980
|
opts: _options,
|
|
14019
13981
|
callback: _cb
|
|
14020
13982
|
};
|
|
14021
|
-
if (
|
|
14022
|
-
new Promise(
|
|
13983
|
+
if (this.#conn.opts.trace) Error.captureStackTrace(cmdParam);
|
|
13984
|
+
new Promise(this.#conn.changeUser.bind(this.#conn, cmdParam)).then(() => {
|
|
14023
13985
|
if (cmdParam.callback) cmdParam.callback(null, null, null);
|
|
14024
|
-
}).catch(cmdParam.callback ||
|
|
13986
|
+
}).catch(cmdParam.callback || this.#noop);
|
|
14025
13987
|
}
|
|
14026
13988
|
/**
|
|
14027
13989
|
* Start transaction
|
|
@@ -14037,12 +13999,12 @@ var require_connection_callback = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
14037
13999
|
* @param callback callback function
|
|
14038
14000
|
*/
|
|
14039
14001
|
commit(callback) {
|
|
14040
|
-
|
|
14002
|
+
this.#conn.changeTransaction(
|
|
14041
14003
|
{ sql: "COMMIT" },
|
|
14042
14004
|
() => {
|
|
14043
14005
|
if (callback) callback(null, null, null);
|
|
14044
14006
|
},
|
|
14045
|
-
callback ||
|
|
14007
|
+
callback || this.#noop
|
|
14046
14008
|
);
|
|
14047
14009
|
}
|
|
14048
14010
|
/**
|
|
@@ -14051,12 +14013,12 @@ var require_connection_callback = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
14051
14013
|
* @param callback callback function
|
|
14052
14014
|
*/
|
|
14053
14015
|
rollback(callback) {
|
|
14054
|
-
|
|
14016
|
+
this.#conn.changeTransaction(
|
|
14055
14017
|
{ sql: "ROLLBACK" },
|
|
14056
14018
|
() => {
|
|
14057
14019
|
if (callback) callback(null, null, null);
|
|
14058
14020
|
},
|
|
14059
|
-
callback ||
|
|
14021
|
+
callback || this.#noop
|
|
14060
14022
|
);
|
|
14061
14023
|
}
|
|
14062
14024
|
/**
|
|
@@ -14069,8 +14031,8 @@ var require_connection_callback = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
14069
14031
|
* @param callback callback function
|
|
14070
14032
|
*/
|
|
14071
14033
|
query(sql, values, callback) {
|
|
14072
|
-
const cmdParam =
|
|
14073
|
-
return
|
|
14034
|
+
const cmdParam = _ConnectionCallback._PARAM(this.#conn.opts, sql, values, callback);
|
|
14035
|
+
return _ConnectionCallback._QUERY_CMD(this.#conn, cmdParam);
|
|
14074
14036
|
}
|
|
14075
14037
|
static _QUERY_CMD(conn, cmdParam) {
|
|
14076
14038
|
let cmd;
|
|
@@ -14103,9 +14065,9 @@ var require_connection_callback = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
14103
14065
|
return cmd;
|
|
14104
14066
|
}
|
|
14105
14067
|
execute(sql, values, callback) {
|
|
14106
|
-
const cmdParam =
|
|
14068
|
+
const cmdParam = _ConnectionCallback._PARAM(this.#conn.opts, sql, values, callback);
|
|
14107
14069
|
cmdParam.opts = cmdParam.opts ? Object.assign(cmdParam.opts, { metaAsArray: true }) : { metaAsArray: true };
|
|
14108
|
-
|
|
14070
|
+
this.#conn.prepareExecute(cmdParam).then(([rows, meta]) => {
|
|
14109
14071
|
if (cmdParam.callback) {
|
|
14110
14072
|
cmdParam.callback(null, rows, meta);
|
|
14111
14073
|
}
|
|
@@ -14134,7 +14096,7 @@ var require_connection_callback = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
14134
14096
|
opts: _cmdOpt,
|
|
14135
14097
|
callback: _cb
|
|
14136
14098
|
};
|
|
14137
|
-
if (options.trace) Error.captureStackTrace(cmdParam,
|
|
14099
|
+
if (options.trace) Error.captureStackTrace(cmdParam, _ConnectionCallback._PARAM);
|
|
14138
14100
|
return cmdParam;
|
|
14139
14101
|
}
|
|
14140
14102
|
static _EXECUTE_CMD(conn, cmdParam) {
|
|
@@ -14163,10 +14125,10 @@ var require_connection_callback = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
14163
14125
|
opts: _cmdOpt,
|
|
14164
14126
|
callback
|
|
14165
14127
|
};
|
|
14166
|
-
if (
|
|
14167
|
-
return new Promise(
|
|
14128
|
+
if (this.#conn.opts.trace) Error.captureStackTrace(cmdParam);
|
|
14129
|
+
return new Promise(this.#conn.prepare.bind(this.#conn, cmdParam)).then((prepare) => {
|
|
14168
14130
|
if (callback) callback(null, prepare, null);
|
|
14169
|
-
}).catch(callback ||
|
|
14131
|
+
}).catch(callback || this.#noop);
|
|
14170
14132
|
}
|
|
14171
14133
|
/**
|
|
14172
14134
|
* Execute a batch
|
|
@@ -14178,8 +14140,8 @@ var require_connection_callback = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
14178
14140
|
* @param callback callback
|
|
14179
14141
|
*/
|
|
14180
14142
|
batch(sql, values, callback) {
|
|
14181
|
-
const cmdParam =
|
|
14182
|
-
return
|
|
14143
|
+
const cmdParam = _ConnectionCallback._PARAM(this.#conn.opts, sql, values, callback);
|
|
14144
|
+
return _ConnectionCallback._BATCH_CMD(this.#conn, cmdParam);
|
|
14183
14145
|
}
|
|
14184
14146
|
static _BATCH_CMD(conn, cmdParam) {
|
|
14185
14147
|
conn.batch(cmdParam).then((res) => {
|
|
@@ -14201,7 +14163,7 @@ var require_connection_callback = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
14201
14163
|
Errors.createError(
|
|
14202
14164
|
"SQL file parameter is mandatory",
|
|
14203
14165
|
Errors.ER_MISSING_SQL_PARAMETER,
|
|
14204
|
-
|
|
14166
|
+
this.#conn.info,
|
|
14205
14167
|
"HY000",
|
|
14206
14168
|
null,
|
|
14207
14169
|
false,
|
|
@@ -14210,7 +14172,7 @@ var require_connection_callback = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
14210
14172
|
);
|
|
14211
14173
|
return;
|
|
14212
14174
|
}
|
|
14213
|
-
new Promise(
|
|
14175
|
+
new Promise(this.#conn.importFile.bind(this.#conn, { file: opts.file, database: opts.database })).then(() => {
|
|
14214
14176
|
if (cb) cb();
|
|
14215
14177
|
}).catch((err) => {
|
|
14216
14178
|
if (cb) cb(err);
|
|
@@ -14233,8 +14195,8 @@ var require_connection_callback = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
14233
14195
|
opts: _cmdOpt,
|
|
14234
14196
|
callback: _cb
|
|
14235
14197
|
};
|
|
14236
|
-
if (
|
|
14237
|
-
new Promise(
|
|
14198
|
+
if (this.#conn.opts.trace) Error.captureStackTrace(cmdParam);
|
|
14199
|
+
new Promise(this.#conn.ping.bind(this.#conn, cmdParam)).then(_cb || this.#noop).catch(_cb || this.#noop);
|
|
14238
14200
|
}
|
|
14239
14201
|
/**
|
|
14240
14202
|
* Send a reset command that will
|
|
@@ -14249,15 +14211,15 @@ var require_connection_callback = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
14249
14211
|
*/
|
|
14250
14212
|
reset(callback) {
|
|
14251
14213
|
const cmdParam = {};
|
|
14252
|
-
if (
|
|
14253
|
-
return new Promise(
|
|
14214
|
+
if (this.#conn.opts.trace) Error.captureStackTrace(cmdParam);
|
|
14215
|
+
return new Promise(this.#conn.reset.bind(this.#conn, cmdParam)).then(callback || this.#noop).catch(callback || this.#noop);
|
|
14254
14216
|
}
|
|
14255
14217
|
/**
|
|
14256
14218
|
* Indicates the state of the connection as the driver knows it
|
|
14257
14219
|
* @returns {boolean}
|
|
14258
14220
|
*/
|
|
14259
14221
|
isValid() {
|
|
14260
|
-
return
|
|
14222
|
+
return this.#conn.isValid();
|
|
14261
14223
|
}
|
|
14262
14224
|
/**
|
|
14263
14225
|
* Terminate connection gracefully.
|
|
@@ -14266,10 +14228,10 @@ var require_connection_callback = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
14266
14228
|
*/
|
|
14267
14229
|
end(callback) {
|
|
14268
14230
|
const cmdParam = {};
|
|
14269
|
-
if (
|
|
14270
|
-
new Promise(
|
|
14231
|
+
if (this.#conn.opts.trace) Error.captureStackTrace(cmdParam);
|
|
14232
|
+
new Promise(this.#conn.end.bind(this.#conn, cmdParam)).then(() => {
|
|
14271
14233
|
if (callback) callback();
|
|
14272
|
-
}).catch(callback ||
|
|
14234
|
+
}).catch(callback || this.#noop);
|
|
14273
14235
|
}
|
|
14274
14236
|
/**
|
|
14275
14237
|
* Alias for destroy.
|
|
@@ -14281,16 +14243,16 @@ var require_connection_callback = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
14281
14243
|
* Force connection termination by closing the underlying socket and killing server process if any.
|
|
14282
14244
|
*/
|
|
14283
14245
|
destroy() {
|
|
14284
|
-
|
|
14246
|
+
this.#conn.destroy();
|
|
14285
14247
|
}
|
|
14286
14248
|
pause() {
|
|
14287
|
-
|
|
14249
|
+
this.#conn.pause();
|
|
14288
14250
|
}
|
|
14289
14251
|
resume() {
|
|
14290
|
-
|
|
14252
|
+
this.#conn.resume();
|
|
14291
14253
|
}
|
|
14292
14254
|
format(sql, values) {
|
|
14293
|
-
|
|
14255
|
+
this.#conn.format(sql, values);
|
|
14294
14256
|
}
|
|
14295
14257
|
/**
|
|
14296
14258
|
* return current connected server version information.
|
|
@@ -14298,39 +14260,39 @@ var require_connection_callback = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
14298
14260
|
* @returns {*}
|
|
14299
14261
|
*/
|
|
14300
14262
|
serverVersion() {
|
|
14301
|
-
return
|
|
14263
|
+
return this.#conn.serverVersion();
|
|
14302
14264
|
}
|
|
14303
14265
|
/**
|
|
14304
14266
|
* Change option "debug" during connection.
|
|
14305
14267
|
* @param val debug value
|
|
14306
14268
|
*/
|
|
14307
14269
|
debug(val) {
|
|
14308
|
-
return
|
|
14270
|
+
return this.#conn.debug(val);
|
|
14309
14271
|
}
|
|
14310
14272
|
debugCompress(val) {
|
|
14311
|
-
return
|
|
14273
|
+
return this.#conn.debugCompress(val);
|
|
14312
14274
|
}
|
|
14313
14275
|
escape(val) {
|
|
14314
|
-
return
|
|
14276
|
+
return this.#conn.escape(val);
|
|
14315
14277
|
}
|
|
14316
14278
|
escapeId(val) {
|
|
14317
|
-
return
|
|
14279
|
+
return this.#conn.escapeId(val);
|
|
14318
14280
|
}
|
|
14319
14281
|
//*****************************************************************
|
|
14320
14282
|
// internal public testing methods
|
|
14321
14283
|
//*****************************************************************
|
|
14322
14284
|
get __tests() {
|
|
14323
|
-
return
|
|
14285
|
+
return this.#conn.__tests;
|
|
14324
14286
|
}
|
|
14325
14287
|
connect(callback) {
|
|
14326
14288
|
if (!callback) {
|
|
14327
14289
|
throw new Errors.createError(
|
|
14328
14290
|
"missing mandatory callback parameter",
|
|
14329
14291
|
Errors.ER_MISSING_PARAMETER,
|
|
14330
|
-
|
|
14292
|
+
this.#conn.info
|
|
14331
14293
|
);
|
|
14332
14294
|
}
|
|
14333
|
-
switch (
|
|
14295
|
+
switch (this.#conn.status) {
|
|
14334
14296
|
case Status.NOT_CONNECTED:
|
|
14335
14297
|
case Status.CONNECTING:
|
|
14336
14298
|
case Status.AUTHENTICATING:
|
|
@@ -14347,7 +14309,7 @@ var require_connection_callback = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
14347
14309
|
Errors.createError(
|
|
14348
14310
|
"Connection closed",
|
|
14349
14311
|
Errors.ER_CONNECTION_ALREADY_CLOSED,
|
|
14350
|
-
|
|
14312
|
+
this.#conn.info,
|
|
14351
14313
|
"08S01",
|
|
14352
14314
|
null,
|
|
14353
14315
|
true
|
|
@@ -14360,120 +14322,116 @@ var require_connection_callback = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
14360
14322
|
// EventEmitter proxy methods
|
|
14361
14323
|
//*****************************************************************
|
|
14362
14324
|
on(eventName, listener) {
|
|
14363
|
-
|
|
14325
|
+
this.#conn.on.call(this.#conn, eventName, listener);
|
|
14364
14326
|
return this;
|
|
14365
14327
|
}
|
|
14366
14328
|
off(eventName, listener) {
|
|
14367
|
-
|
|
14329
|
+
this.#conn.off.call(this.#conn, eventName, listener);
|
|
14368
14330
|
return this;
|
|
14369
14331
|
}
|
|
14370
14332
|
once(eventName, listener) {
|
|
14371
|
-
|
|
14333
|
+
this.#conn.once.call(this.#conn, eventName, listener);
|
|
14372
14334
|
return this;
|
|
14373
14335
|
}
|
|
14374
14336
|
listeners(eventName) {
|
|
14375
|
-
return
|
|
14337
|
+
return this.#conn.listeners.call(this.#conn, eventName);
|
|
14376
14338
|
}
|
|
14377
14339
|
addListener(eventName, listener) {
|
|
14378
|
-
|
|
14340
|
+
this.#conn.addListener.call(this.#conn, eventName, listener);
|
|
14379
14341
|
return this;
|
|
14380
14342
|
}
|
|
14381
14343
|
eventNames() {
|
|
14382
|
-
return
|
|
14344
|
+
return this.#conn.eventNames.call(this.#conn);
|
|
14383
14345
|
}
|
|
14384
14346
|
getMaxListeners() {
|
|
14385
|
-
return
|
|
14347
|
+
return this.#conn.getMaxListeners.call(this.#conn);
|
|
14386
14348
|
}
|
|
14387
14349
|
listenerCount(eventName, listener) {
|
|
14388
|
-
return
|
|
14350
|
+
return this.#conn.listenerCount.call(this.#conn, eventName, listener);
|
|
14389
14351
|
}
|
|
14390
14352
|
prependListener(eventName, listener) {
|
|
14391
|
-
|
|
14353
|
+
this.#conn.prependListener.call(this.#conn, eventName, listener);
|
|
14392
14354
|
return this;
|
|
14393
14355
|
}
|
|
14394
14356
|
prependOnceListener(eventName, listener) {
|
|
14395
|
-
|
|
14357
|
+
this.#conn.prependOnceListener.call(this.#conn, eventName, listener);
|
|
14396
14358
|
return this;
|
|
14397
14359
|
}
|
|
14398
14360
|
removeAllListeners(eventName, listener) {
|
|
14399
|
-
|
|
14361
|
+
this.#conn.removeAllListeners.call(this.#conn, eventName, listener);
|
|
14400
14362
|
return this;
|
|
14401
14363
|
}
|
|
14402
14364
|
removeListener(eventName, listener) {
|
|
14403
|
-
|
|
14365
|
+
this.#conn.removeListener.call(this.#conn, eventName, listener);
|
|
14404
14366
|
return this;
|
|
14405
14367
|
}
|
|
14406
14368
|
setMaxListeners(n) {
|
|
14407
|
-
|
|
14369
|
+
this.#conn.setMaxListeners.call(this.#conn, n);
|
|
14408
14370
|
return this;
|
|
14409
14371
|
}
|
|
14410
14372
|
rawListeners(eventName) {
|
|
14411
|
-
return
|
|
14373
|
+
return this.#conn.rawListeners.call(this.#conn, eventName);
|
|
14412
14374
|
}
|
|
14413
14375
|
};
|
|
14414
|
-
_conn = /* @__PURE__ */ new WeakMap();
|
|
14415
|
-
_noop = /* @__PURE__ */ new WeakMap();
|
|
14416
|
-
var ConnectionCallback = _ConnectionCallback;
|
|
14417
14376
|
module2.exports = ConnectionCallback;
|
|
14418
14377
|
}
|
|
14419
14378
|
});
|
|
14420
|
-
var require_pool_callback = (0,
|
|
14379
|
+
var require_pool_callback = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
14421
14380
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/pool-callback.js"(exports, module2) {
|
|
14422
14381
|
"use strict";
|
|
14423
|
-
var { EventEmitter } = (0,
|
|
14382
|
+
var { EventEmitter } = (0, import_chunk_2ESYSVXG.__require)("events");
|
|
14424
14383
|
var Pool = require_pool();
|
|
14425
14384
|
var Errors = require_errors();
|
|
14426
14385
|
var ConnectionCallback = require_connection_callback();
|
|
14427
|
-
var _pool, _noop;
|
|
14428
14386
|
var PoolCallback = class extends EventEmitter {
|
|
14387
|
+
#pool;
|
|
14429
14388
|
constructor(options) {
|
|
14430
14389
|
super();
|
|
14431
|
-
|
|
14432
|
-
(
|
|
14433
|
-
|
|
14434
|
-
(
|
|
14435
|
-
|
|
14436
|
-
|
|
14437
|
-
|
|
14438
|
-
|
|
14439
|
-
|
|
14440
|
-
}
|
|
14390
|
+
this.#pool = new Pool(options);
|
|
14391
|
+
this.#pool.on("acquire", this.emit.bind(this, "acquire"));
|
|
14392
|
+
this.#pool.on("connection", this.emit.bind(this, "connection"));
|
|
14393
|
+
this.#pool.on("enqueue", this.emit.bind(this, "enqueue"));
|
|
14394
|
+
this.#pool.on("release", this.emit.bind(this, "release"));
|
|
14395
|
+
this.#pool.on("error", this.emit.bind(this, "error"));
|
|
14396
|
+
}
|
|
14397
|
+
#noop = () => {
|
|
14398
|
+
};
|
|
14441
14399
|
get closed() {
|
|
14442
|
-
return
|
|
14400
|
+
return this.#pool.closed;
|
|
14443
14401
|
}
|
|
14444
14402
|
/**
|
|
14445
14403
|
* Get current total connection number.
|
|
14446
14404
|
* @return {number}
|
|
14447
14405
|
*/
|
|
14448
14406
|
totalConnections() {
|
|
14449
|
-
return
|
|
14407
|
+
return this.#pool.totalConnections();
|
|
14450
14408
|
}
|
|
14451
14409
|
/**
|
|
14452
14410
|
* Get current active connections.
|
|
14453
14411
|
* @return {number}
|
|
14454
14412
|
*/
|
|
14455
14413
|
activeConnections() {
|
|
14456
|
-
return
|
|
14414
|
+
return this.#pool.activeConnections();
|
|
14457
14415
|
}
|
|
14458
14416
|
/**
|
|
14459
14417
|
* Get current idle connection number.
|
|
14460
14418
|
* @return {number}
|
|
14461
14419
|
*/
|
|
14462
14420
|
idleConnections() {
|
|
14463
|
-
return
|
|
14421
|
+
return this.#pool.idleConnections();
|
|
14464
14422
|
}
|
|
14465
14423
|
/**
|
|
14466
14424
|
* Get current stacked connection request.
|
|
14467
14425
|
* @return {number}
|
|
14468
14426
|
*/
|
|
14469
14427
|
taskQueueSize() {
|
|
14470
|
-
return
|
|
14428
|
+
return this.#pool.taskQueueSize();
|
|
14471
14429
|
}
|
|
14472
14430
|
escape(value) {
|
|
14473
|
-
return
|
|
14431
|
+
return this.#pool.escape(value);
|
|
14474
14432
|
}
|
|
14475
14433
|
escapeId(value) {
|
|
14476
|
-
return
|
|
14434
|
+
return this.#pool.escapeId(value);
|
|
14477
14435
|
}
|
|
14478
14436
|
/**
|
|
14479
14437
|
* Ends pool
|
|
@@ -14481,9 +14439,9 @@ var require_pool_callback = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
14481
14439
|
* @param callback
|
|
14482
14440
|
*/
|
|
14483
14441
|
end(callback) {
|
|
14484
|
-
|
|
14442
|
+
this.#pool.end().then(() => {
|
|
14485
14443
|
if (callback) callback(null);
|
|
14486
|
-
}).catch(callback ||
|
|
14444
|
+
}).catch(callback || this.#noop);
|
|
14487
14445
|
}
|
|
14488
14446
|
/**
|
|
14489
14447
|
* Retrieve a connection from pool.
|
|
@@ -14497,8 +14455,8 @@ var require_pool_callback = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
14497
14455
|
throw new Errors.createError("missing mandatory callback parameter", Errors.ER_MISSING_PARAMETER);
|
|
14498
14456
|
}
|
|
14499
14457
|
const cmdParam = {};
|
|
14500
|
-
if (
|
|
14501
|
-
|
|
14458
|
+
if (this.#pool.opts.connOptions.trace) Error.captureStackTrace(cmdParam);
|
|
14459
|
+
this.#pool.getConnection(cmdParam).then((baseConn) => {
|
|
14502
14460
|
const cc = new ConnectionCallback(baseConn);
|
|
14503
14461
|
cc.end = (cb2) => cc.release(cb2);
|
|
14504
14462
|
cc.close = (cb2) => cc.release(cb2);
|
|
@@ -14515,11 +14473,11 @@ var require_pool_callback = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
14515
14473
|
* @param cb callback
|
|
14516
14474
|
*/
|
|
14517
14475
|
query(sql, values, cb) {
|
|
14518
|
-
const cmdParam = ConnectionCallback._PARAM(
|
|
14519
|
-
|
|
14476
|
+
const cmdParam = ConnectionCallback._PARAM(this.#pool.opts.connOptions, sql, values, cb);
|
|
14477
|
+
this.#pool.getConnection(cmdParam).then((baseConn) => {
|
|
14520
14478
|
const _cb = cmdParam.callback;
|
|
14521
14479
|
cmdParam.callback = (err, rows, meta) => {
|
|
14522
|
-
|
|
14480
|
+
this.#pool.release(baseConn);
|
|
14523
14481
|
if (_cb) _cb(err, rows, meta);
|
|
14524
14482
|
};
|
|
14525
14483
|
ConnectionCallback._QUERY_CMD(baseConn, cmdParam);
|
|
@@ -14537,11 +14495,11 @@ var require_pool_callback = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
14537
14495
|
* @param cb callback
|
|
14538
14496
|
*/
|
|
14539
14497
|
execute(sql, values, cb) {
|
|
14540
|
-
const cmdParam = ConnectionCallback._PARAM(
|
|
14541
|
-
|
|
14498
|
+
const cmdParam = ConnectionCallback._PARAM(this.#pool.opts.connOptions, sql, values, cb);
|
|
14499
|
+
this.#pool.getConnection(cmdParam).then((baseConn) => {
|
|
14542
14500
|
const _cb = cmdParam.callback;
|
|
14543
14501
|
cmdParam.callback = (err, rows, meta) => {
|
|
14544
|
-
|
|
14502
|
+
this.#pool.release(baseConn);
|
|
14545
14503
|
if (_cb) _cb(err, rows, meta);
|
|
14546
14504
|
};
|
|
14547
14505
|
ConnectionCallback._EXECUTE_CMD(baseConn, cmdParam);
|
|
@@ -14558,11 +14516,11 @@ var require_pool_callback = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
14558
14516
|
* @param cb callback
|
|
14559
14517
|
*/
|
|
14560
14518
|
batch(sql, values, cb) {
|
|
14561
|
-
const cmdParam = ConnectionCallback._PARAM(
|
|
14562
|
-
|
|
14519
|
+
const cmdParam = ConnectionCallback._PARAM(this.#pool.opts.connOptions, sql, values, cb);
|
|
14520
|
+
this.#pool.getConnection(cmdParam).then((baseConn) => {
|
|
14563
14521
|
const _cb = cmdParam.callback;
|
|
14564
14522
|
cmdParam.callback = (err, rows, meta) => {
|
|
14565
|
-
|
|
14523
|
+
this.#pool.release(baseConn);
|
|
14566
14524
|
if (_cb) _cb(err, rows, meta);
|
|
14567
14525
|
};
|
|
14568
14526
|
ConnectionCallback._BATCH_CMD(baseConn, cmdParam);
|
|
@@ -14592,10 +14550,10 @@ var require_pool_callback = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
14592
14550
|
);
|
|
14593
14551
|
return;
|
|
14594
14552
|
}
|
|
14595
|
-
|
|
14553
|
+
this.#pool.getConnection({}).then((baseConn) => {
|
|
14596
14554
|
return new Promise(baseConn.importFile.bind(baseConn, { file: opts.file, database: opts.database })).finally(
|
|
14597
14555
|
() => {
|
|
14598
|
-
|
|
14556
|
+
this.#pool.release(baseConn);
|
|
14599
14557
|
}
|
|
14600
14558
|
);
|
|
14601
14559
|
}).then(() => {
|
|
@@ -14605,26 +14563,23 @@ var require_pool_callback = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
14605
14563
|
});
|
|
14606
14564
|
}
|
|
14607
14565
|
toString() {
|
|
14608
|
-
return "poolCallback(" +
|
|
14566
|
+
return "poolCallback(" + this.#pool.toString() + ")";
|
|
14609
14567
|
}
|
|
14610
14568
|
};
|
|
14611
|
-
_pool = /* @__PURE__ */ new WeakMap();
|
|
14612
|
-
_noop = /* @__PURE__ */ new WeakMap();
|
|
14613
14569
|
module2.exports = PoolCallback;
|
|
14614
14570
|
}
|
|
14615
14571
|
});
|
|
14616
|
-
var require_filtered_cluster = (0,
|
|
14572
|
+
var require_filtered_cluster = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
14617
14573
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/filtered-cluster.js"(exports, module2) {
|
|
14618
14574
|
"use strict";
|
|
14619
|
-
var _cluster, _pattern, _selector;
|
|
14620
14575
|
var FilteredCluster = class {
|
|
14576
|
+
#cluster;
|
|
14577
|
+
#pattern;
|
|
14578
|
+
#selector;
|
|
14621
14579
|
constructor(poolCluster, patternArg, selectorArg) {
|
|
14622
|
-
|
|
14623
|
-
|
|
14624
|
-
|
|
14625
|
-
(0, import_chunk_WWAWV7DQ.__privateSet)(this, _cluster, poolCluster);
|
|
14626
|
-
(0, import_chunk_WWAWV7DQ.__privateSet)(this, _pattern, patternArg);
|
|
14627
|
-
(0, import_chunk_WWAWV7DQ.__privateSet)(this, _selector, selectorArg);
|
|
14580
|
+
this.#cluster = poolCluster;
|
|
14581
|
+
this.#pattern = patternArg;
|
|
14582
|
+
this.#selector = selectorArg;
|
|
14628
14583
|
}
|
|
14629
14584
|
/**
|
|
14630
14585
|
* Get a connection according to previously indicated pattern and selector.
|
|
@@ -14632,7 +14587,7 @@ var require_filtered_cluster = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
14632
14587
|
* @return {Promise}
|
|
14633
14588
|
*/
|
|
14634
14589
|
getConnection() {
|
|
14635
|
-
return
|
|
14590
|
+
return this.#cluster.getConnection(this.#pattern, this.#selector);
|
|
14636
14591
|
}
|
|
14637
14592
|
/**
|
|
14638
14593
|
* Execute a text query on one connection from available pools matching pattern
|
|
@@ -14643,7 +14598,7 @@ var require_filtered_cluster = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
14643
14598
|
* @return {Promise}
|
|
14644
14599
|
*/
|
|
14645
14600
|
query(sql, value) {
|
|
14646
|
-
return
|
|
14601
|
+
return this.#cluster.getConnection(this.#pattern, this.#selector).then((conn) => {
|
|
14647
14602
|
return conn.query(sql, value).then((res) => {
|
|
14648
14603
|
conn.release();
|
|
14649
14604
|
return res;
|
|
@@ -14664,7 +14619,7 @@ var require_filtered_cluster = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
14664
14619
|
* @return {Promise}
|
|
14665
14620
|
*/
|
|
14666
14621
|
execute(sql, value) {
|
|
14667
|
-
return
|
|
14622
|
+
return this.#cluster.getConnection(this.#pattern, this.#selector).then((conn) => {
|
|
14668
14623
|
return conn.execute(sql, value).then((res) => {
|
|
14669
14624
|
conn.release();
|
|
14670
14625
|
return res;
|
|
@@ -14685,7 +14640,7 @@ var require_filtered_cluster = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
14685
14640
|
* @return {Promise}
|
|
14686
14641
|
*/
|
|
14687
14642
|
batch(sql, value) {
|
|
14688
|
-
return
|
|
14643
|
+
return this.#cluster.getConnection(this.#pattern, this.#selector).then((conn) => {
|
|
14689
14644
|
return conn.batch(sql, value).then((res) => {
|
|
14690
14645
|
conn.release();
|
|
14691
14646
|
return res;
|
|
@@ -14698,13 +14653,10 @@ var require_filtered_cluster = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
14698
14653
|
});
|
|
14699
14654
|
}
|
|
14700
14655
|
};
|
|
14701
|
-
_cluster = /* @__PURE__ */ new WeakMap();
|
|
14702
|
-
_pattern = /* @__PURE__ */ new WeakMap();
|
|
14703
|
-
_selector = /* @__PURE__ */ new WeakMap();
|
|
14704
14656
|
module2.exports = FilteredCluster;
|
|
14705
14657
|
}
|
|
14706
14658
|
});
|
|
14707
|
-
var require_cluster = (0,
|
|
14659
|
+
var require_cluster = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
14708
14660
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/lib/cluster.js"(exports, module2) {
|
|
14709
14661
|
"use strict";
|
|
14710
14662
|
var ClusterOptions = require_cluster_options();
|
|
@@ -14712,16 +14664,15 @@ var require_cluster = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
14712
14664
|
var PoolCallback = require_pool_callback();
|
|
14713
14665
|
var PoolPromise = require_pool_promise();
|
|
14714
14666
|
var FilteredCluster = require_filtered_cluster();
|
|
14715
|
-
var EventEmitter = (0,
|
|
14716
|
-
var _opts, _nodes, _cachedPatterns, _nodeCounter;
|
|
14667
|
+
var EventEmitter = (0, import_chunk_2ESYSVXG.__require)("events");
|
|
14717
14668
|
var Cluster = class extends EventEmitter {
|
|
14669
|
+
#opts;
|
|
14670
|
+
#nodes = {};
|
|
14671
|
+
#cachedPatterns = {};
|
|
14672
|
+
#nodeCounter = 0;
|
|
14718
14673
|
constructor(args) {
|
|
14719
14674
|
super();
|
|
14720
|
-
|
|
14721
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _nodes, {});
|
|
14722
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _cachedPatterns, {});
|
|
14723
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _nodeCounter, 0);
|
|
14724
|
-
(0, import_chunk_WWAWV7DQ.__privateSet)(this, _opts, new ClusterOptions(args));
|
|
14675
|
+
this.#opts = new ClusterOptions(args);
|
|
14725
14676
|
}
|
|
14726
14677
|
/**
|
|
14727
14678
|
* Add a new pool node to cluster.
|
|
@@ -14733,13 +14684,13 @@ var require_cluster = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
14733
14684
|
let identifier;
|
|
14734
14685
|
if (typeof id === "string" || id instanceof String) {
|
|
14735
14686
|
identifier = id;
|
|
14736
|
-
if (
|
|
14687
|
+
if (this.#nodes[identifier]) throw new Error(`Node identifier '${identifier}' already exist !`);
|
|
14737
14688
|
} else {
|
|
14738
|
-
identifier = "PoolNode-" +
|
|
14689
|
+
identifier = "PoolNode-" + this.#nodeCounter++;
|
|
14739
14690
|
config = id;
|
|
14740
14691
|
}
|
|
14741
14692
|
const options = new PoolOptions(config);
|
|
14742
|
-
|
|
14693
|
+
this.#nodes[identifier] = this._createPool(options);
|
|
14743
14694
|
}
|
|
14744
14695
|
/**
|
|
14745
14696
|
* End cluster (and underlying pools).
|
|
@@ -14748,13 +14699,13 @@ var require_cluster = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
14748
14699
|
*/
|
|
14749
14700
|
end() {
|
|
14750
14701
|
const cluster = this;
|
|
14751
|
-
|
|
14702
|
+
this.#cachedPatterns = {};
|
|
14752
14703
|
const poolEndPromise = [];
|
|
14753
|
-
Object.keys(
|
|
14754
|
-
const res =
|
|
14704
|
+
Object.keys(this.#nodes).forEach((pool) => {
|
|
14705
|
+
const res = cluster.#nodes[pool].end();
|
|
14755
14706
|
if (res) poolEndPromise.push(res);
|
|
14756
14707
|
});
|
|
14757
|
-
|
|
14708
|
+
this.#nodes = null;
|
|
14758
14709
|
return Promise.all(poolEndPromise);
|
|
14759
14710
|
}
|
|
14760
14711
|
of(pattern, selector) {
|
|
@@ -14768,12 +14719,12 @@ var require_cluster = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
14768
14719
|
remove(pattern) {
|
|
14769
14720
|
if (!pattern) throw new Error("pattern parameter in Cluster.remove(pattern) is mandatory");
|
|
14770
14721
|
const regex = RegExp(pattern);
|
|
14771
|
-
Object.keys(
|
|
14722
|
+
Object.keys(this.#nodes).forEach(
|
|
14772
14723
|
function(key) {
|
|
14773
14724
|
if (regex.test(key)) {
|
|
14774
|
-
|
|
14775
|
-
delete
|
|
14776
|
-
|
|
14725
|
+
this.#nodes[key].end();
|
|
14726
|
+
delete this.#nodes[key];
|
|
14727
|
+
this.#cachedPatterns = {};
|
|
14777
14728
|
}
|
|
14778
14729
|
}.bind(this)
|
|
14779
14730
|
);
|
|
@@ -14810,7 +14761,7 @@ var require_cluster = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
14810
14761
|
_getConnection(pattern, selector, remainingRetry, avoidNodeKey, lastError) {
|
|
14811
14762
|
const matchingNodeList = this._matchingNodes(pattern || /^/);
|
|
14812
14763
|
if (matchingNodeList.length === 0) {
|
|
14813
|
-
if (Object.keys(
|
|
14764
|
+
if (Object.keys(this.#nodes).length === 0 && !lastError) {
|
|
14814
14765
|
return Promise.reject(
|
|
14815
14766
|
new Error("No node have been added to cluster or nodes have been removed due to too much connection error")
|
|
14816
14767
|
);
|
|
@@ -14854,7 +14805,7 @@ var require_cluster = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
14854
14805
|
_getConnectionCallback(pattern, selector, callback, avoidNodeKey, lastError) {
|
|
14855
14806
|
const matchingNodeList = this._matchingNodes(pattern || /^/);
|
|
14856
14807
|
if (matchingNodeList.length === 0) {
|
|
14857
|
-
if (Object.keys(
|
|
14808
|
+
if (Object.keys(this.#nodes).length === 0 && !lastError) {
|
|
14858
14809
|
callback(
|
|
14859
14810
|
new Error("No node have been added to cluster or nodes have been removed due to too much connection error")
|
|
14860
14811
|
);
|
|
@@ -14881,15 +14832,15 @@ var require_cluster = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
14881
14832
|
* @private
|
|
14882
14833
|
*/
|
|
14883
14834
|
_matchingNodes(pattern) {
|
|
14884
|
-
if (
|
|
14835
|
+
if (this.#cachedPatterns[pattern]) return this.#cachedPatterns[pattern];
|
|
14885
14836
|
const regex = RegExp(pattern);
|
|
14886
14837
|
const matchingNodeList = [];
|
|
14887
|
-
Object.keys(
|
|
14838
|
+
Object.keys(this.#nodes).forEach((key) => {
|
|
14888
14839
|
if (regex.test(key)) {
|
|
14889
14840
|
matchingNodeList.push(key);
|
|
14890
14841
|
}
|
|
14891
14842
|
});
|
|
14892
|
-
|
|
14843
|
+
this.#cachedPatterns[pattern] = matchingNodeList;
|
|
14893
14844
|
return matchingNodeList;
|
|
14894
14845
|
}
|
|
14895
14846
|
/**
|
|
@@ -14902,7 +14853,7 @@ var require_cluster = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
14902
14853
|
* @private
|
|
14903
14854
|
*/
|
|
14904
14855
|
_selectPool(nodeList, selectorParam, avoidNodeKey) {
|
|
14905
|
-
const selector = selectorParam ||
|
|
14856
|
+
const selector = selectorParam || this.#opts.defaultSelector;
|
|
14906
14857
|
let selectorFct;
|
|
14907
14858
|
switch (selector) {
|
|
14908
14859
|
case "RR":
|
|
@@ -14919,7 +14870,7 @@ var require_cluster = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
14919
14870
|
}
|
|
14920
14871
|
let nodeIdx = 0;
|
|
14921
14872
|
let nodeKey = selectorFct(nodeList, nodeIdx);
|
|
14922
|
-
while ((avoidNodeKey === nodeKey ||
|
|
14873
|
+
while ((avoidNodeKey === nodeKey || this.#nodes[nodeKey].blacklistedUntil && this.#nodes[nodeKey].blacklistedUntil > Date.now()) && nodeIdx < nodeList.length - 1) {
|
|
14923
14874
|
nodeIdx++;
|
|
14924
14875
|
nodeKey = selectorFct(nodeList, nodeIdx);
|
|
14925
14876
|
}
|
|
@@ -14943,23 +14894,23 @@ var require_cluster = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
14943
14894
|
*/
|
|
14944
14895
|
_handleConnectionError(nodeList, nodeKey, retryFct) {
|
|
14945
14896
|
const cluster = this;
|
|
14946
|
-
const node =
|
|
14897
|
+
const node = this.#nodes[nodeKey];
|
|
14947
14898
|
return node.getConnection().then((conn) => {
|
|
14948
14899
|
node.blacklistedUntil = null;
|
|
14949
14900
|
node.errorCount = 0;
|
|
14950
14901
|
return Promise.resolve(conn);
|
|
14951
14902
|
}).catch((err) => {
|
|
14952
14903
|
node.errorCount = node.errorCount ? node.errorCount + 1 : 1;
|
|
14953
|
-
node.blacklistedUntil = Date.now() +
|
|
14954
|
-
if (
|
|
14955
|
-
delete
|
|
14956
|
-
|
|
14904
|
+
node.blacklistedUntil = Date.now() + cluster.#opts.restoreNodeTimeout;
|
|
14905
|
+
if (cluster.#opts.removeNodeErrorCount && node.errorCount >= cluster.#opts.removeNodeErrorCount && cluster.#nodes[nodeKey]) {
|
|
14906
|
+
delete cluster.#nodes[nodeKey];
|
|
14907
|
+
cluster.#cachedPatterns = {};
|
|
14957
14908
|
delete nodeList.lastRrIdx;
|
|
14958
14909
|
setImmediate(cluster.emit.bind(cluster, "remove", nodeKey));
|
|
14959
14910
|
node.end().catch((err2) => {
|
|
14960
14911
|
});
|
|
14961
14912
|
}
|
|
14962
|
-
if (nodeList.length !== 0 &&
|
|
14913
|
+
if (nodeList.length !== 0 && cluster.#opts.canRetry && retryFct) {
|
|
14963
14914
|
return retryFct(nodeKey, err);
|
|
14964
14915
|
}
|
|
14965
14916
|
return Promise.reject(err);
|
|
@@ -14976,20 +14927,20 @@ var require_cluster = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
14976
14927
|
*/
|
|
14977
14928
|
_handleConnectionCallbackError(nodeList, nodeKey, retryFct, callback) {
|
|
14978
14929
|
const cluster = this;
|
|
14979
|
-
const node =
|
|
14930
|
+
const node = this.#nodes[nodeKey];
|
|
14980
14931
|
node.getConnection((err, conn) => {
|
|
14981
14932
|
if (err) {
|
|
14982
14933
|
node.errorCount = node.errorCount ? node.errorCount + 1 : 1;
|
|
14983
|
-
node.blacklistedUntil = Date.now() +
|
|
14984
|
-
if (
|
|
14985
|
-
delete
|
|
14986
|
-
|
|
14934
|
+
node.blacklistedUntil = Date.now() + cluster.#opts.restoreNodeTimeout;
|
|
14935
|
+
if (cluster.#opts.removeNodeErrorCount && node.errorCount >= cluster.#opts.removeNodeErrorCount && cluster.#nodes[nodeKey]) {
|
|
14936
|
+
delete cluster.#nodes[nodeKey];
|
|
14937
|
+
cluster.#cachedPatterns = {};
|
|
14987
14938
|
delete nodeList.lastRrIdx;
|
|
14988
14939
|
setImmediate(cluster.emit.bind(cluster, "remove", nodeKey));
|
|
14989
14940
|
node.end(() => {
|
|
14990
14941
|
});
|
|
14991
14942
|
}
|
|
14992
|
-
if (nodeList.length !== 0 &&
|
|
14943
|
+
if (nodeList.length !== 0 && cluster.#opts.canRetry && retryFct) {
|
|
14993
14944
|
return retryFct(nodeKey, err);
|
|
14994
14945
|
}
|
|
14995
14946
|
callback(err);
|
|
@@ -15003,24 +14954,18 @@ var require_cluster = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
15003
14954
|
// internal public testing methods
|
|
15004
14955
|
//*****************************************************************
|
|
15005
14956
|
get __tests() {
|
|
15006
|
-
return new TestMethods(
|
|
14957
|
+
return new TestMethods(this.#nodes);
|
|
15007
14958
|
}
|
|
15008
14959
|
};
|
|
15009
|
-
_opts = /* @__PURE__ */ new WeakMap();
|
|
15010
|
-
_nodes = /* @__PURE__ */ new WeakMap();
|
|
15011
|
-
_cachedPatterns = /* @__PURE__ */ new WeakMap();
|
|
15012
|
-
_nodeCounter = /* @__PURE__ */ new WeakMap();
|
|
15013
|
-
var _nodes2;
|
|
15014
14960
|
var TestMethods = class {
|
|
14961
|
+
#nodes;
|
|
15015
14962
|
constructor(nodes) {
|
|
15016
|
-
|
|
15017
|
-
(0, import_chunk_WWAWV7DQ.__privateSet)(this, _nodes2, nodes);
|
|
14963
|
+
this.#nodes = nodes;
|
|
15018
14964
|
}
|
|
15019
14965
|
getNodes() {
|
|
15020
|
-
return
|
|
14966
|
+
return this.#nodes;
|
|
15021
14967
|
}
|
|
15022
14968
|
};
|
|
15023
|
-
_nodes2 = /* @__PURE__ */ new WeakMap();
|
|
15024
14969
|
var roundRobinSelector = (nodeList) => {
|
|
15025
14970
|
let lastRoundRobin = nodeList.lastRrIdx;
|
|
15026
14971
|
if (lastRoundRobin === void 0) lastRoundRobin = -1;
|
|
@@ -15038,7 +14983,7 @@ var require_cluster = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
15038
14983
|
module2.exports = Cluster;
|
|
15039
14984
|
}
|
|
15040
14985
|
});
|
|
15041
|
-
var require_promise = (0,
|
|
14986
|
+
var require_promise = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
15042
14987
|
"../../node_modules/.pnpm/mariadb@3.4.0/node_modules/mariadb/promise.js"(exports, module2) {
|
|
15043
14988
|
"use strict";
|
|
15044
14989
|
require_check_node();
|
|
@@ -15097,7 +15042,7 @@ var require_promise = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
15097
15042
|
};
|
|
15098
15043
|
}
|
|
15099
15044
|
});
|
|
15100
|
-
var import_mariadb = (0,
|
|
15045
|
+
var import_mariadb = (0, import_chunk_2ESYSVXG.__toESM)(require_promise());
|
|
15101
15046
|
async function setupMysql(options) {
|
|
15102
15047
|
const { connectionString } = options;
|
|
15103
15048
|
const { dirname } = options;
|