kysely-gen 0.8.0 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +145 -894
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -30159,771 +30159,6 @@ var require_mysql2 = __commonJS((exports) => {
|
|
|
30159
30159
|
};
|
|
30160
30160
|
});
|
|
30161
30161
|
|
|
30162
|
-
// node_modules/better-sqlite3/lib/util.js
|
|
30163
|
-
var require_util = __commonJS((exports) => {
|
|
30164
|
-
exports.getBooleanOption = (options, key) => {
|
|
30165
|
-
let value = false;
|
|
30166
|
-
if (key in options && typeof (value = options[key]) !== "boolean") {
|
|
30167
|
-
throw new TypeError(`Expected the "${key}" option to be a boolean`);
|
|
30168
|
-
}
|
|
30169
|
-
return value;
|
|
30170
|
-
};
|
|
30171
|
-
exports.cppdb = Symbol();
|
|
30172
|
-
exports.inspect = Symbol.for("nodejs.util.inspect.custom");
|
|
30173
|
-
});
|
|
30174
|
-
|
|
30175
|
-
// node_modules/better-sqlite3/lib/sqlite-error.js
|
|
30176
|
-
var require_sqlite_error = __commonJS((exports, module) => {
|
|
30177
|
-
var descriptor = { value: "SqliteError", writable: true, enumerable: false, configurable: true };
|
|
30178
|
-
function SqliteError(message, code) {
|
|
30179
|
-
if (new.target !== SqliteError) {
|
|
30180
|
-
return new SqliteError(message, code);
|
|
30181
|
-
}
|
|
30182
|
-
if (typeof code !== "string") {
|
|
30183
|
-
throw new TypeError("Expected second argument to be a string");
|
|
30184
|
-
}
|
|
30185
|
-
Error.call(this, message);
|
|
30186
|
-
descriptor.value = "" + message;
|
|
30187
|
-
Object.defineProperty(this, "message", descriptor);
|
|
30188
|
-
Error.captureStackTrace(this, SqliteError);
|
|
30189
|
-
this.code = code;
|
|
30190
|
-
}
|
|
30191
|
-
Object.setPrototypeOf(SqliteError, Error);
|
|
30192
|
-
Object.setPrototypeOf(SqliteError.prototype, Error.prototype);
|
|
30193
|
-
Object.defineProperty(SqliteError.prototype, "name", descriptor);
|
|
30194
|
-
module.exports = SqliteError;
|
|
30195
|
-
});
|
|
30196
|
-
|
|
30197
|
-
// node_modules/file-uri-to-path/index.js
|
|
30198
|
-
var require_file_uri_to_path = __commonJS((exports, module) => {
|
|
30199
|
-
var sep = __require("path").sep || "/";
|
|
30200
|
-
module.exports = fileUriToPath;
|
|
30201
|
-
function fileUriToPath(uri) {
|
|
30202
|
-
if (typeof uri != "string" || uri.length <= 7 || uri.substring(0, 7) != "file://") {
|
|
30203
|
-
throw new TypeError("must pass in a file:// URI to convert to a file path");
|
|
30204
|
-
}
|
|
30205
|
-
var rest = decodeURI(uri.substring(7));
|
|
30206
|
-
var firstSlash = rest.indexOf("/");
|
|
30207
|
-
var host = rest.substring(0, firstSlash);
|
|
30208
|
-
var path = rest.substring(firstSlash + 1);
|
|
30209
|
-
if (host == "localhost")
|
|
30210
|
-
host = "";
|
|
30211
|
-
if (host) {
|
|
30212
|
-
host = sep + sep + host;
|
|
30213
|
-
}
|
|
30214
|
-
path = path.replace(/^(.+)\|/, "$1:");
|
|
30215
|
-
if (sep == "\\") {
|
|
30216
|
-
path = path.replace(/\//g, "\\");
|
|
30217
|
-
}
|
|
30218
|
-
if (/^.+\:/.test(path)) {} else {
|
|
30219
|
-
path = sep + path;
|
|
30220
|
-
}
|
|
30221
|
-
return host + path;
|
|
30222
|
-
}
|
|
30223
|
-
});
|
|
30224
|
-
|
|
30225
|
-
// node_modules/bindings/bindings.js
|
|
30226
|
-
var require_bindings = __commonJS((exports, module) => {
|
|
30227
|
-
var __filename = "/home/runner/work/kysely-gen/kysely-gen/node_modules/bindings/bindings.js";
|
|
30228
|
-
var fs = __require("fs");
|
|
30229
|
-
var path = __require("path");
|
|
30230
|
-
var fileURLToPath = require_file_uri_to_path();
|
|
30231
|
-
var join = path.join;
|
|
30232
|
-
var dirname = path.dirname;
|
|
30233
|
-
var exists = fs.accessSync && function(path2) {
|
|
30234
|
-
try {
|
|
30235
|
-
fs.accessSync(path2);
|
|
30236
|
-
} catch (e) {
|
|
30237
|
-
return false;
|
|
30238
|
-
}
|
|
30239
|
-
return true;
|
|
30240
|
-
} || fs.existsSync || path.existsSync;
|
|
30241
|
-
var defaults2 = {
|
|
30242
|
-
arrow: process.env.NODE_BINDINGS_ARROW || " → ",
|
|
30243
|
-
compiled: process.env.NODE_BINDINGS_COMPILED_DIR || "compiled",
|
|
30244
|
-
platform: process.platform,
|
|
30245
|
-
arch: process.arch,
|
|
30246
|
-
nodePreGyp: "node-v" + process.versions.modules + "-" + process.platform + "-" + process.arch,
|
|
30247
|
-
version: process.versions.node,
|
|
30248
|
-
bindings: "bindings.node",
|
|
30249
|
-
try: [
|
|
30250
|
-
["module_root", "build", "bindings"],
|
|
30251
|
-
["module_root", "build", "Debug", "bindings"],
|
|
30252
|
-
["module_root", "build", "Release", "bindings"],
|
|
30253
|
-
["module_root", "out", "Debug", "bindings"],
|
|
30254
|
-
["module_root", "Debug", "bindings"],
|
|
30255
|
-
["module_root", "out", "Release", "bindings"],
|
|
30256
|
-
["module_root", "Release", "bindings"],
|
|
30257
|
-
["module_root", "build", "default", "bindings"],
|
|
30258
|
-
["module_root", "compiled", "version", "platform", "arch", "bindings"],
|
|
30259
|
-
["module_root", "addon-build", "release", "install-root", "bindings"],
|
|
30260
|
-
["module_root", "addon-build", "debug", "install-root", "bindings"],
|
|
30261
|
-
["module_root", "addon-build", "default", "install-root", "bindings"],
|
|
30262
|
-
["module_root", "lib", "binding", "nodePreGyp", "bindings"]
|
|
30263
|
-
]
|
|
30264
|
-
};
|
|
30265
|
-
function bindings(opts) {
|
|
30266
|
-
if (typeof opts == "string") {
|
|
30267
|
-
opts = { bindings: opts };
|
|
30268
|
-
} else if (!opts) {
|
|
30269
|
-
opts = {};
|
|
30270
|
-
}
|
|
30271
|
-
Object.keys(defaults2).map(function(i2) {
|
|
30272
|
-
if (!(i2 in opts))
|
|
30273
|
-
opts[i2] = defaults2[i2];
|
|
30274
|
-
});
|
|
30275
|
-
if (!opts.module_root) {
|
|
30276
|
-
opts.module_root = exports.getRoot(exports.getFileName());
|
|
30277
|
-
}
|
|
30278
|
-
if (path.extname(opts.bindings) != ".node") {
|
|
30279
|
-
opts.bindings += ".node";
|
|
30280
|
-
}
|
|
30281
|
-
var requireFunc = typeof __webpack_require__ === "function" ? __non_webpack_require__ : __require;
|
|
30282
|
-
var tries = [], i = 0, l = opts.try.length, n, b, err;
|
|
30283
|
-
for (;i < l; i++) {
|
|
30284
|
-
n = join.apply(null, opts.try[i].map(function(p) {
|
|
30285
|
-
return opts[p] || p;
|
|
30286
|
-
}));
|
|
30287
|
-
tries.push(n);
|
|
30288
|
-
try {
|
|
30289
|
-
b = opts.path ? requireFunc.resolve(n) : requireFunc(n);
|
|
30290
|
-
if (!opts.path) {
|
|
30291
|
-
b.path = n;
|
|
30292
|
-
}
|
|
30293
|
-
return b;
|
|
30294
|
-
} catch (e) {
|
|
30295
|
-
if (e.code !== "MODULE_NOT_FOUND" && e.code !== "QUALIFIED_PATH_RESOLUTION_FAILED" && !/not find/i.test(e.message)) {
|
|
30296
|
-
throw e;
|
|
30297
|
-
}
|
|
30298
|
-
}
|
|
30299
|
-
}
|
|
30300
|
-
err = new Error(`Could not locate the bindings file. Tried:
|
|
30301
|
-
` + tries.map(function(a) {
|
|
30302
|
-
return opts.arrow + a;
|
|
30303
|
-
}).join(`
|
|
30304
|
-
`));
|
|
30305
|
-
err.tries = tries;
|
|
30306
|
-
throw err;
|
|
30307
|
-
}
|
|
30308
|
-
module.exports = exports = bindings;
|
|
30309
|
-
exports.getFileName = function getFileName(calling_file) {
|
|
30310
|
-
var { prepareStackTrace: origPST, stackTraceLimit: origSTL } = Error, dummy = {}, fileName;
|
|
30311
|
-
Error.stackTraceLimit = 10;
|
|
30312
|
-
Error.prepareStackTrace = function(e, st) {
|
|
30313
|
-
for (var i = 0, l = st.length;i < l; i++) {
|
|
30314
|
-
fileName = st[i].getFileName();
|
|
30315
|
-
if (fileName !== __filename) {
|
|
30316
|
-
if (calling_file) {
|
|
30317
|
-
if (fileName !== calling_file) {
|
|
30318
|
-
return;
|
|
30319
|
-
}
|
|
30320
|
-
} else {
|
|
30321
|
-
return;
|
|
30322
|
-
}
|
|
30323
|
-
}
|
|
30324
|
-
}
|
|
30325
|
-
};
|
|
30326
|
-
Error.captureStackTrace(dummy);
|
|
30327
|
-
dummy.stack;
|
|
30328
|
-
Error.prepareStackTrace = origPST;
|
|
30329
|
-
Error.stackTraceLimit = origSTL;
|
|
30330
|
-
var fileSchema = "file://";
|
|
30331
|
-
if (fileName.indexOf(fileSchema) === 0) {
|
|
30332
|
-
fileName = fileURLToPath(fileName);
|
|
30333
|
-
}
|
|
30334
|
-
return fileName;
|
|
30335
|
-
};
|
|
30336
|
-
exports.getRoot = function getRoot(file) {
|
|
30337
|
-
var dir = dirname(file), prev;
|
|
30338
|
-
while (true) {
|
|
30339
|
-
if (dir === ".") {
|
|
30340
|
-
dir = process.cwd();
|
|
30341
|
-
}
|
|
30342
|
-
if (exists(join(dir, "package.json")) || exists(join(dir, "node_modules"))) {
|
|
30343
|
-
return dir;
|
|
30344
|
-
}
|
|
30345
|
-
if (prev === dir) {
|
|
30346
|
-
throw new Error('Could not find module root given file: "' + file + '". Do you have a `package.json` file? ');
|
|
30347
|
-
}
|
|
30348
|
-
prev = dir;
|
|
30349
|
-
dir = join(dir, "..");
|
|
30350
|
-
}
|
|
30351
|
-
};
|
|
30352
|
-
});
|
|
30353
|
-
|
|
30354
|
-
// node_modules/better-sqlite3/lib/methods/wrappers.js
|
|
30355
|
-
var require_wrappers = __commonJS((exports) => {
|
|
30356
|
-
var { cppdb } = require_util();
|
|
30357
|
-
exports.prepare = function prepare(sql2) {
|
|
30358
|
-
return this[cppdb].prepare(sql2, this, false);
|
|
30359
|
-
};
|
|
30360
|
-
exports.exec = function exec(sql2) {
|
|
30361
|
-
this[cppdb].exec(sql2);
|
|
30362
|
-
return this;
|
|
30363
|
-
};
|
|
30364
|
-
exports.close = function close() {
|
|
30365
|
-
this[cppdb].close();
|
|
30366
|
-
return this;
|
|
30367
|
-
};
|
|
30368
|
-
exports.loadExtension = function loadExtension(...args) {
|
|
30369
|
-
this[cppdb].loadExtension(...args);
|
|
30370
|
-
return this;
|
|
30371
|
-
};
|
|
30372
|
-
exports.defaultSafeIntegers = function defaultSafeIntegers(...args) {
|
|
30373
|
-
this[cppdb].defaultSafeIntegers(...args);
|
|
30374
|
-
return this;
|
|
30375
|
-
};
|
|
30376
|
-
exports.unsafeMode = function unsafeMode(...args) {
|
|
30377
|
-
this[cppdb].unsafeMode(...args);
|
|
30378
|
-
return this;
|
|
30379
|
-
};
|
|
30380
|
-
exports.getters = {
|
|
30381
|
-
name: {
|
|
30382
|
-
get: function name() {
|
|
30383
|
-
return this[cppdb].name;
|
|
30384
|
-
},
|
|
30385
|
-
enumerable: true
|
|
30386
|
-
},
|
|
30387
|
-
open: {
|
|
30388
|
-
get: function open() {
|
|
30389
|
-
return this[cppdb].open;
|
|
30390
|
-
},
|
|
30391
|
-
enumerable: true
|
|
30392
|
-
},
|
|
30393
|
-
inTransaction: {
|
|
30394
|
-
get: function inTransaction() {
|
|
30395
|
-
return this[cppdb].inTransaction;
|
|
30396
|
-
},
|
|
30397
|
-
enumerable: true
|
|
30398
|
-
},
|
|
30399
|
-
readonly: {
|
|
30400
|
-
get: function readonly() {
|
|
30401
|
-
return this[cppdb].readonly;
|
|
30402
|
-
},
|
|
30403
|
-
enumerable: true
|
|
30404
|
-
},
|
|
30405
|
-
memory: {
|
|
30406
|
-
get: function memory() {
|
|
30407
|
-
return this[cppdb].memory;
|
|
30408
|
-
},
|
|
30409
|
-
enumerable: true
|
|
30410
|
-
}
|
|
30411
|
-
};
|
|
30412
|
-
});
|
|
30413
|
-
|
|
30414
|
-
// node_modules/better-sqlite3/lib/methods/transaction.js
|
|
30415
|
-
var require_transaction = __commonJS((exports, module) => {
|
|
30416
|
-
var { cppdb } = require_util();
|
|
30417
|
-
var controllers = new WeakMap;
|
|
30418
|
-
module.exports = function transaction(fn) {
|
|
30419
|
-
if (typeof fn !== "function")
|
|
30420
|
-
throw new TypeError("Expected first argument to be a function");
|
|
30421
|
-
const db = this[cppdb];
|
|
30422
|
-
const controller = getController(db, this);
|
|
30423
|
-
const { apply } = Function.prototype;
|
|
30424
|
-
const properties = {
|
|
30425
|
-
default: { value: wrapTransaction(apply, fn, db, controller.default) },
|
|
30426
|
-
deferred: { value: wrapTransaction(apply, fn, db, controller.deferred) },
|
|
30427
|
-
immediate: { value: wrapTransaction(apply, fn, db, controller.immediate) },
|
|
30428
|
-
exclusive: { value: wrapTransaction(apply, fn, db, controller.exclusive) },
|
|
30429
|
-
database: { value: this, enumerable: true }
|
|
30430
|
-
};
|
|
30431
|
-
Object.defineProperties(properties.default.value, properties);
|
|
30432
|
-
Object.defineProperties(properties.deferred.value, properties);
|
|
30433
|
-
Object.defineProperties(properties.immediate.value, properties);
|
|
30434
|
-
Object.defineProperties(properties.exclusive.value, properties);
|
|
30435
|
-
return properties.default.value;
|
|
30436
|
-
};
|
|
30437
|
-
var getController = (db, self2) => {
|
|
30438
|
-
let controller = controllers.get(db);
|
|
30439
|
-
if (!controller) {
|
|
30440
|
-
const shared = {
|
|
30441
|
-
commit: db.prepare("COMMIT", self2, false),
|
|
30442
|
-
rollback: db.prepare("ROLLBACK", self2, false),
|
|
30443
|
-
savepoint: db.prepare("SAVEPOINT `\t_bs3.\t`", self2, false),
|
|
30444
|
-
release: db.prepare("RELEASE `\t_bs3.\t`", self2, false),
|
|
30445
|
-
rollbackTo: db.prepare("ROLLBACK TO `\t_bs3.\t`", self2, false)
|
|
30446
|
-
};
|
|
30447
|
-
controllers.set(db, controller = {
|
|
30448
|
-
default: Object.assign({ begin: db.prepare("BEGIN", self2, false) }, shared),
|
|
30449
|
-
deferred: Object.assign({ begin: db.prepare("BEGIN DEFERRED", self2, false) }, shared),
|
|
30450
|
-
immediate: Object.assign({ begin: db.prepare("BEGIN IMMEDIATE", self2, false) }, shared),
|
|
30451
|
-
exclusive: Object.assign({ begin: db.prepare("BEGIN EXCLUSIVE", self2, false) }, shared)
|
|
30452
|
-
});
|
|
30453
|
-
}
|
|
30454
|
-
return controller;
|
|
30455
|
-
};
|
|
30456
|
-
var wrapTransaction = (apply, fn, db, { begin, commit, rollback, savepoint, release, rollbackTo }) => function sqliteTransaction() {
|
|
30457
|
-
let before, after, undo;
|
|
30458
|
-
if (db.inTransaction) {
|
|
30459
|
-
before = savepoint;
|
|
30460
|
-
after = release;
|
|
30461
|
-
undo = rollbackTo;
|
|
30462
|
-
} else {
|
|
30463
|
-
before = begin;
|
|
30464
|
-
after = commit;
|
|
30465
|
-
undo = rollback;
|
|
30466
|
-
}
|
|
30467
|
-
before.run();
|
|
30468
|
-
try {
|
|
30469
|
-
const result = apply.call(fn, this, arguments);
|
|
30470
|
-
if (result && typeof result.then === "function") {
|
|
30471
|
-
throw new TypeError("Transaction function cannot return a promise");
|
|
30472
|
-
}
|
|
30473
|
-
after.run();
|
|
30474
|
-
return result;
|
|
30475
|
-
} catch (ex) {
|
|
30476
|
-
if (db.inTransaction) {
|
|
30477
|
-
undo.run();
|
|
30478
|
-
if (undo !== rollback)
|
|
30479
|
-
after.run();
|
|
30480
|
-
}
|
|
30481
|
-
throw ex;
|
|
30482
|
-
}
|
|
30483
|
-
};
|
|
30484
|
-
});
|
|
30485
|
-
|
|
30486
|
-
// node_modules/better-sqlite3/lib/methods/pragma.js
|
|
30487
|
-
var require_pragma = __commonJS((exports, module) => {
|
|
30488
|
-
var { getBooleanOption, cppdb } = require_util();
|
|
30489
|
-
module.exports = function pragma(source, options) {
|
|
30490
|
-
if (options == null)
|
|
30491
|
-
options = {};
|
|
30492
|
-
if (typeof source !== "string")
|
|
30493
|
-
throw new TypeError("Expected first argument to be a string");
|
|
30494
|
-
if (typeof options !== "object")
|
|
30495
|
-
throw new TypeError("Expected second argument to be an options object");
|
|
30496
|
-
const simple = getBooleanOption(options, "simple");
|
|
30497
|
-
const stmt = this[cppdb].prepare(`PRAGMA ${source}`, this, true);
|
|
30498
|
-
return simple ? stmt.pluck().get() : stmt.all();
|
|
30499
|
-
};
|
|
30500
|
-
});
|
|
30501
|
-
|
|
30502
|
-
// node_modules/better-sqlite3/lib/methods/backup.js
|
|
30503
|
-
var require_backup = __commonJS((exports, module) => {
|
|
30504
|
-
var fs = __require("fs");
|
|
30505
|
-
var path = __require("path");
|
|
30506
|
-
var { promisify } = __require("util");
|
|
30507
|
-
var { cppdb } = require_util();
|
|
30508
|
-
var fsAccess = promisify(fs.access);
|
|
30509
|
-
module.exports = async function backup(filename, options) {
|
|
30510
|
-
if (options == null)
|
|
30511
|
-
options = {};
|
|
30512
|
-
if (typeof filename !== "string")
|
|
30513
|
-
throw new TypeError("Expected first argument to be a string");
|
|
30514
|
-
if (typeof options !== "object")
|
|
30515
|
-
throw new TypeError("Expected second argument to be an options object");
|
|
30516
|
-
filename = filename.trim();
|
|
30517
|
-
const attachedName = "attached" in options ? options.attached : "main";
|
|
30518
|
-
const handler = "progress" in options ? options.progress : null;
|
|
30519
|
-
if (!filename)
|
|
30520
|
-
throw new TypeError("Backup filename cannot be an empty string");
|
|
30521
|
-
if (filename === ":memory:")
|
|
30522
|
-
throw new TypeError('Invalid backup filename ":memory:"');
|
|
30523
|
-
if (typeof attachedName !== "string")
|
|
30524
|
-
throw new TypeError('Expected the "attached" option to be a string');
|
|
30525
|
-
if (!attachedName)
|
|
30526
|
-
throw new TypeError('The "attached" option cannot be an empty string');
|
|
30527
|
-
if (handler != null && typeof handler !== "function")
|
|
30528
|
-
throw new TypeError('Expected the "progress" option to be a function');
|
|
30529
|
-
await fsAccess(path.dirname(filename)).catch(() => {
|
|
30530
|
-
throw new TypeError("Cannot save backup because the directory does not exist");
|
|
30531
|
-
});
|
|
30532
|
-
const isNewFile = await fsAccess(filename).then(() => false, () => true);
|
|
30533
|
-
return runBackup(this[cppdb].backup(this, attachedName, filename, isNewFile), handler || null);
|
|
30534
|
-
};
|
|
30535
|
-
var runBackup = (backup, handler) => {
|
|
30536
|
-
let rate = 0;
|
|
30537
|
-
let useDefault = true;
|
|
30538
|
-
return new Promise((resolve, reject) => {
|
|
30539
|
-
setImmediate(function step() {
|
|
30540
|
-
try {
|
|
30541
|
-
const progress = backup.transfer(rate);
|
|
30542
|
-
if (!progress.remainingPages) {
|
|
30543
|
-
backup.close();
|
|
30544
|
-
resolve(progress);
|
|
30545
|
-
return;
|
|
30546
|
-
}
|
|
30547
|
-
if (useDefault) {
|
|
30548
|
-
useDefault = false;
|
|
30549
|
-
rate = 100;
|
|
30550
|
-
}
|
|
30551
|
-
if (handler) {
|
|
30552
|
-
const ret = handler(progress);
|
|
30553
|
-
if (ret !== undefined) {
|
|
30554
|
-
if (typeof ret === "number" && ret === ret)
|
|
30555
|
-
rate = Math.max(0, Math.min(2147483647, Math.round(ret)));
|
|
30556
|
-
else
|
|
30557
|
-
throw new TypeError("Expected progress callback to return a number or undefined");
|
|
30558
|
-
}
|
|
30559
|
-
}
|
|
30560
|
-
setImmediate(step);
|
|
30561
|
-
} catch (err) {
|
|
30562
|
-
backup.close();
|
|
30563
|
-
reject(err);
|
|
30564
|
-
}
|
|
30565
|
-
});
|
|
30566
|
-
});
|
|
30567
|
-
};
|
|
30568
|
-
});
|
|
30569
|
-
|
|
30570
|
-
// node_modules/better-sqlite3/lib/methods/serialize.js
|
|
30571
|
-
var require_serialize = __commonJS((exports, module) => {
|
|
30572
|
-
var { cppdb } = require_util();
|
|
30573
|
-
module.exports = function serialize(options) {
|
|
30574
|
-
if (options == null)
|
|
30575
|
-
options = {};
|
|
30576
|
-
if (typeof options !== "object")
|
|
30577
|
-
throw new TypeError("Expected first argument to be an options object");
|
|
30578
|
-
const attachedName = "attached" in options ? options.attached : "main";
|
|
30579
|
-
if (typeof attachedName !== "string")
|
|
30580
|
-
throw new TypeError('Expected the "attached" option to be a string');
|
|
30581
|
-
if (!attachedName)
|
|
30582
|
-
throw new TypeError('The "attached" option cannot be an empty string');
|
|
30583
|
-
return this[cppdb].serialize(attachedName);
|
|
30584
|
-
};
|
|
30585
|
-
});
|
|
30586
|
-
|
|
30587
|
-
// node_modules/better-sqlite3/lib/methods/function.js
|
|
30588
|
-
var require_function = __commonJS((exports, module) => {
|
|
30589
|
-
var { getBooleanOption, cppdb } = require_util();
|
|
30590
|
-
module.exports = function defineFunction(name, options, fn) {
|
|
30591
|
-
if (options == null)
|
|
30592
|
-
options = {};
|
|
30593
|
-
if (typeof options === "function") {
|
|
30594
|
-
fn = options;
|
|
30595
|
-
options = {};
|
|
30596
|
-
}
|
|
30597
|
-
if (typeof name !== "string")
|
|
30598
|
-
throw new TypeError("Expected first argument to be a string");
|
|
30599
|
-
if (typeof fn !== "function")
|
|
30600
|
-
throw new TypeError("Expected last argument to be a function");
|
|
30601
|
-
if (typeof options !== "object")
|
|
30602
|
-
throw new TypeError("Expected second argument to be an options object");
|
|
30603
|
-
if (!name)
|
|
30604
|
-
throw new TypeError("User-defined function name cannot be an empty string");
|
|
30605
|
-
const safeIntegers = "safeIntegers" in options ? +getBooleanOption(options, "safeIntegers") : 2;
|
|
30606
|
-
const deterministic = getBooleanOption(options, "deterministic");
|
|
30607
|
-
const directOnly = getBooleanOption(options, "directOnly");
|
|
30608
|
-
const varargs = getBooleanOption(options, "varargs");
|
|
30609
|
-
let argCount = -1;
|
|
30610
|
-
if (!varargs) {
|
|
30611
|
-
argCount = fn.length;
|
|
30612
|
-
if (!Number.isInteger(argCount) || argCount < 0)
|
|
30613
|
-
throw new TypeError("Expected function.length to be a positive integer");
|
|
30614
|
-
if (argCount > 100)
|
|
30615
|
-
throw new RangeError("User-defined functions cannot have more than 100 arguments");
|
|
30616
|
-
}
|
|
30617
|
-
this[cppdb].function(fn, name, argCount, safeIntegers, deterministic, directOnly);
|
|
30618
|
-
return this;
|
|
30619
|
-
};
|
|
30620
|
-
});
|
|
30621
|
-
|
|
30622
|
-
// node_modules/better-sqlite3/lib/methods/aggregate.js
|
|
30623
|
-
var require_aggregate = __commonJS((exports, module) => {
|
|
30624
|
-
var { getBooleanOption, cppdb } = require_util();
|
|
30625
|
-
module.exports = function defineAggregate(name, options) {
|
|
30626
|
-
if (typeof name !== "string")
|
|
30627
|
-
throw new TypeError("Expected first argument to be a string");
|
|
30628
|
-
if (typeof options !== "object" || options === null)
|
|
30629
|
-
throw new TypeError("Expected second argument to be an options object");
|
|
30630
|
-
if (!name)
|
|
30631
|
-
throw new TypeError("User-defined function name cannot be an empty string");
|
|
30632
|
-
const start = "start" in options ? options.start : null;
|
|
30633
|
-
const step = getFunctionOption(options, "step", true);
|
|
30634
|
-
const inverse2 = getFunctionOption(options, "inverse", false);
|
|
30635
|
-
const result = getFunctionOption(options, "result", false);
|
|
30636
|
-
const safeIntegers = "safeIntegers" in options ? +getBooleanOption(options, "safeIntegers") : 2;
|
|
30637
|
-
const deterministic = getBooleanOption(options, "deterministic");
|
|
30638
|
-
const directOnly = getBooleanOption(options, "directOnly");
|
|
30639
|
-
const varargs = getBooleanOption(options, "varargs");
|
|
30640
|
-
let argCount = -1;
|
|
30641
|
-
if (!varargs) {
|
|
30642
|
-
argCount = Math.max(getLength(step), inverse2 ? getLength(inverse2) : 0);
|
|
30643
|
-
if (argCount > 0)
|
|
30644
|
-
argCount -= 1;
|
|
30645
|
-
if (argCount > 100)
|
|
30646
|
-
throw new RangeError("User-defined functions cannot have more than 100 arguments");
|
|
30647
|
-
}
|
|
30648
|
-
this[cppdb].aggregate(start, step, inverse2, result, name, argCount, safeIntegers, deterministic, directOnly);
|
|
30649
|
-
return this;
|
|
30650
|
-
};
|
|
30651
|
-
var getFunctionOption = (options, key, required) => {
|
|
30652
|
-
const value = key in options ? options[key] : null;
|
|
30653
|
-
if (typeof value === "function")
|
|
30654
|
-
return value;
|
|
30655
|
-
if (value != null)
|
|
30656
|
-
throw new TypeError(`Expected the "${key}" option to be a function`);
|
|
30657
|
-
if (required)
|
|
30658
|
-
throw new TypeError(`Missing required option "${key}"`);
|
|
30659
|
-
return null;
|
|
30660
|
-
};
|
|
30661
|
-
var getLength = ({ length }) => {
|
|
30662
|
-
if (Number.isInteger(length) && length >= 0)
|
|
30663
|
-
return length;
|
|
30664
|
-
throw new TypeError("Expected function.length to be a positive integer");
|
|
30665
|
-
};
|
|
30666
|
-
});
|
|
30667
|
-
|
|
30668
|
-
// node_modules/better-sqlite3/lib/methods/table.js
|
|
30669
|
-
var require_table = __commonJS((exports, module) => {
|
|
30670
|
-
var { cppdb } = require_util();
|
|
30671
|
-
module.exports = function defineTable(name, factory) {
|
|
30672
|
-
if (typeof name !== "string")
|
|
30673
|
-
throw new TypeError("Expected first argument to be a string");
|
|
30674
|
-
if (!name)
|
|
30675
|
-
throw new TypeError("Virtual table module name cannot be an empty string");
|
|
30676
|
-
let eponymous = false;
|
|
30677
|
-
if (typeof factory === "object" && factory !== null) {
|
|
30678
|
-
eponymous = true;
|
|
30679
|
-
factory = defer(parseTableDefinition(factory, "used", name));
|
|
30680
|
-
} else {
|
|
30681
|
-
if (typeof factory !== "function")
|
|
30682
|
-
throw new TypeError("Expected second argument to be a function or a table definition object");
|
|
30683
|
-
factory = wrapFactory(factory);
|
|
30684
|
-
}
|
|
30685
|
-
this[cppdb].table(factory, name, eponymous);
|
|
30686
|
-
return this;
|
|
30687
|
-
};
|
|
30688
|
-
function wrapFactory(factory) {
|
|
30689
|
-
return function virtualTableFactory(moduleName, databaseName, tableName, ...args) {
|
|
30690
|
-
const thisObject = {
|
|
30691
|
-
module: moduleName,
|
|
30692
|
-
database: databaseName,
|
|
30693
|
-
table: tableName
|
|
30694
|
-
};
|
|
30695
|
-
const def = apply.call(factory, thisObject, args);
|
|
30696
|
-
if (typeof def !== "object" || def === null) {
|
|
30697
|
-
throw new TypeError(`Virtual table module "${moduleName}" did not return a table definition object`);
|
|
30698
|
-
}
|
|
30699
|
-
return parseTableDefinition(def, "returned", moduleName);
|
|
30700
|
-
};
|
|
30701
|
-
}
|
|
30702
|
-
function parseTableDefinition(def, verb, moduleName) {
|
|
30703
|
-
if (!hasOwnProperty.call(def, "rows")) {
|
|
30704
|
-
throw new TypeError(`Virtual table module "${moduleName}" ${verb} a table definition without a "rows" property`);
|
|
30705
|
-
}
|
|
30706
|
-
if (!hasOwnProperty.call(def, "columns")) {
|
|
30707
|
-
throw new TypeError(`Virtual table module "${moduleName}" ${verb} a table definition without a "columns" property`);
|
|
30708
|
-
}
|
|
30709
|
-
const rows = def.rows;
|
|
30710
|
-
if (typeof rows !== "function" || Object.getPrototypeOf(rows) !== GeneratorFunctionPrototype) {
|
|
30711
|
-
throw new TypeError(`Virtual table module "${moduleName}" ${verb} a table definition with an invalid "rows" property (should be a generator function)`);
|
|
30712
|
-
}
|
|
30713
|
-
let columns = def.columns;
|
|
30714
|
-
if (!Array.isArray(columns) || !(columns = [...columns]).every((x) => typeof x === "string")) {
|
|
30715
|
-
throw new TypeError(`Virtual table module "${moduleName}" ${verb} a table definition with an invalid "columns" property (should be an array of strings)`);
|
|
30716
|
-
}
|
|
30717
|
-
if (columns.length !== new Set(columns).size) {
|
|
30718
|
-
throw new TypeError(`Virtual table module "${moduleName}" ${verb} a table definition with duplicate column names`);
|
|
30719
|
-
}
|
|
30720
|
-
if (!columns.length) {
|
|
30721
|
-
throw new RangeError(`Virtual table module "${moduleName}" ${verb} a table definition with zero columns`);
|
|
30722
|
-
}
|
|
30723
|
-
let parameters;
|
|
30724
|
-
if (hasOwnProperty.call(def, "parameters")) {
|
|
30725
|
-
parameters = def.parameters;
|
|
30726
|
-
if (!Array.isArray(parameters) || !(parameters = [...parameters]).every((x) => typeof x === "string")) {
|
|
30727
|
-
throw new TypeError(`Virtual table module "${moduleName}" ${verb} a table definition with an invalid "parameters" property (should be an array of strings)`);
|
|
30728
|
-
}
|
|
30729
|
-
} else {
|
|
30730
|
-
parameters = inferParameters(rows);
|
|
30731
|
-
}
|
|
30732
|
-
if (parameters.length !== new Set(parameters).size) {
|
|
30733
|
-
throw new TypeError(`Virtual table module "${moduleName}" ${verb} a table definition with duplicate parameter names`);
|
|
30734
|
-
}
|
|
30735
|
-
if (parameters.length > 32) {
|
|
30736
|
-
throw new RangeError(`Virtual table module "${moduleName}" ${verb} a table definition with more than the maximum number of 32 parameters`);
|
|
30737
|
-
}
|
|
30738
|
-
for (const parameter of parameters) {
|
|
30739
|
-
if (columns.includes(parameter)) {
|
|
30740
|
-
throw new TypeError(`Virtual table module "${moduleName}" ${verb} a table definition with column "${parameter}" which was ambiguously defined as both a column and parameter`);
|
|
30741
|
-
}
|
|
30742
|
-
}
|
|
30743
|
-
let safeIntegers = 2;
|
|
30744
|
-
if (hasOwnProperty.call(def, "safeIntegers")) {
|
|
30745
|
-
const bool = def.safeIntegers;
|
|
30746
|
-
if (typeof bool !== "boolean") {
|
|
30747
|
-
throw new TypeError(`Virtual table module "${moduleName}" ${verb} a table definition with an invalid "safeIntegers" property (should be a boolean)`);
|
|
30748
|
-
}
|
|
30749
|
-
safeIntegers = +bool;
|
|
30750
|
-
}
|
|
30751
|
-
let directOnly = false;
|
|
30752
|
-
if (hasOwnProperty.call(def, "directOnly")) {
|
|
30753
|
-
directOnly = def.directOnly;
|
|
30754
|
-
if (typeof directOnly !== "boolean") {
|
|
30755
|
-
throw new TypeError(`Virtual table module "${moduleName}" ${verb} a table definition with an invalid "directOnly" property (should be a boolean)`);
|
|
30756
|
-
}
|
|
30757
|
-
}
|
|
30758
|
-
const columnDefinitions = [
|
|
30759
|
-
...parameters.map(identifier).map((str) => `${str} HIDDEN`),
|
|
30760
|
-
...columns.map(identifier)
|
|
30761
|
-
];
|
|
30762
|
-
return [
|
|
30763
|
-
`CREATE TABLE x(${columnDefinitions.join(", ")});`,
|
|
30764
|
-
wrapGenerator(rows, new Map(columns.map((x, i) => [x, parameters.length + i])), moduleName),
|
|
30765
|
-
parameters,
|
|
30766
|
-
safeIntegers,
|
|
30767
|
-
directOnly
|
|
30768
|
-
];
|
|
30769
|
-
}
|
|
30770
|
-
function wrapGenerator(generator, columnMap, moduleName) {
|
|
30771
|
-
return function* virtualTable(...args) {
|
|
30772
|
-
const output = args.map((x) => Buffer.isBuffer(x) ? Buffer.from(x) : x);
|
|
30773
|
-
for (let i = 0;i < columnMap.size; ++i) {
|
|
30774
|
-
output.push(null);
|
|
30775
|
-
}
|
|
30776
|
-
for (const row of generator(...args)) {
|
|
30777
|
-
if (Array.isArray(row)) {
|
|
30778
|
-
extractRowArray(row, output, columnMap.size, moduleName);
|
|
30779
|
-
yield output;
|
|
30780
|
-
} else if (typeof row === "object" && row !== null) {
|
|
30781
|
-
extractRowObject(row, output, columnMap, moduleName);
|
|
30782
|
-
yield output;
|
|
30783
|
-
} else {
|
|
30784
|
-
throw new TypeError(`Virtual table module "${moduleName}" yielded something that isn't a valid row object`);
|
|
30785
|
-
}
|
|
30786
|
-
}
|
|
30787
|
-
};
|
|
30788
|
-
}
|
|
30789
|
-
function extractRowArray(row, output, columnCount, moduleName) {
|
|
30790
|
-
if (row.length !== columnCount) {
|
|
30791
|
-
throw new TypeError(`Virtual table module "${moduleName}" yielded a row with an incorrect number of columns`);
|
|
30792
|
-
}
|
|
30793
|
-
const offset = output.length - columnCount;
|
|
30794
|
-
for (let i = 0;i < columnCount; ++i) {
|
|
30795
|
-
output[i + offset] = row[i];
|
|
30796
|
-
}
|
|
30797
|
-
}
|
|
30798
|
-
function extractRowObject(row, output, columnMap, moduleName) {
|
|
30799
|
-
let count = 0;
|
|
30800
|
-
for (const key of Object.keys(row)) {
|
|
30801
|
-
const index = columnMap.get(key);
|
|
30802
|
-
if (index === undefined) {
|
|
30803
|
-
throw new TypeError(`Virtual table module "${moduleName}" yielded a row with an undeclared column "${key}"`);
|
|
30804
|
-
}
|
|
30805
|
-
output[index] = row[key];
|
|
30806
|
-
count += 1;
|
|
30807
|
-
}
|
|
30808
|
-
if (count !== columnMap.size) {
|
|
30809
|
-
throw new TypeError(`Virtual table module "${moduleName}" yielded a row with missing columns`);
|
|
30810
|
-
}
|
|
30811
|
-
}
|
|
30812
|
-
function inferParameters({ length }) {
|
|
30813
|
-
if (!Number.isInteger(length) || length < 0) {
|
|
30814
|
-
throw new TypeError("Expected function.length to be a positive integer");
|
|
30815
|
-
}
|
|
30816
|
-
const params = [];
|
|
30817
|
-
for (let i = 0;i < length; ++i) {
|
|
30818
|
-
params.push(`$${i + 1}`);
|
|
30819
|
-
}
|
|
30820
|
-
return params;
|
|
30821
|
-
}
|
|
30822
|
-
var { hasOwnProperty } = Object.prototype;
|
|
30823
|
-
var { apply } = Function.prototype;
|
|
30824
|
-
var GeneratorFunctionPrototype = Object.getPrototypeOf(function* () {});
|
|
30825
|
-
var identifier = (str) => `"${str.replace(/"/g, '""')}"`;
|
|
30826
|
-
var defer = (x) => () => x;
|
|
30827
|
-
});
|
|
30828
|
-
|
|
30829
|
-
// node_modules/better-sqlite3/lib/methods/inspect.js
|
|
30830
|
-
var require_inspect = __commonJS((exports, module) => {
|
|
30831
|
-
var DatabaseInspection = function Database() {};
|
|
30832
|
-
module.exports = function inspect(depth, opts) {
|
|
30833
|
-
return Object.assign(new DatabaseInspection, this);
|
|
30834
|
-
};
|
|
30835
|
-
});
|
|
30836
|
-
|
|
30837
|
-
// node_modules/better-sqlite3/lib/database.js
|
|
30838
|
-
var require_database = __commonJS((exports, module) => {
|
|
30839
|
-
var fs = __require("fs");
|
|
30840
|
-
var path = __require("path");
|
|
30841
|
-
var util = require_util();
|
|
30842
|
-
var SqliteError = require_sqlite_error();
|
|
30843
|
-
var DEFAULT_ADDON;
|
|
30844
|
-
function Database(filenameGiven, options) {
|
|
30845
|
-
if (new.target == null) {
|
|
30846
|
-
return new Database(filenameGiven, options);
|
|
30847
|
-
}
|
|
30848
|
-
let buffer;
|
|
30849
|
-
if (Buffer.isBuffer(filenameGiven)) {
|
|
30850
|
-
buffer = filenameGiven;
|
|
30851
|
-
filenameGiven = ":memory:";
|
|
30852
|
-
}
|
|
30853
|
-
if (filenameGiven == null)
|
|
30854
|
-
filenameGiven = "";
|
|
30855
|
-
if (options == null)
|
|
30856
|
-
options = {};
|
|
30857
|
-
if (typeof filenameGiven !== "string")
|
|
30858
|
-
throw new TypeError("Expected first argument to be a string");
|
|
30859
|
-
if (typeof options !== "object")
|
|
30860
|
-
throw new TypeError("Expected second argument to be an options object");
|
|
30861
|
-
if ("readOnly" in options)
|
|
30862
|
-
throw new TypeError('Misspelled option "readOnly" should be "readonly"');
|
|
30863
|
-
if ("memory" in options)
|
|
30864
|
-
throw new TypeError('Option "memory" was removed in v7.0.0 (use ":memory:" filename instead)');
|
|
30865
|
-
const filename = filenameGiven.trim();
|
|
30866
|
-
const anonymous = filename === "" || filename === ":memory:";
|
|
30867
|
-
const readonly = util.getBooleanOption(options, "readonly");
|
|
30868
|
-
const fileMustExist = util.getBooleanOption(options, "fileMustExist");
|
|
30869
|
-
const timeout = "timeout" in options ? options.timeout : 5000;
|
|
30870
|
-
const verbose = "verbose" in options ? options.verbose : null;
|
|
30871
|
-
const nativeBinding = "nativeBinding" in options ? options.nativeBinding : null;
|
|
30872
|
-
if (readonly && anonymous && !buffer)
|
|
30873
|
-
throw new TypeError("In-memory/temporary databases cannot be readonly");
|
|
30874
|
-
if (!Number.isInteger(timeout) || timeout < 0)
|
|
30875
|
-
throw new TypeError('Expected the "timeout" option to be a positive integer');
|
|
30876
|
-
if (timeout > 2147483647)
|
|
30877
|
-
throw new RangeError('Option "timeout" cannot be greater than 2147483647');
|
|
30878
|
-
if (verbose != null && typeof verbose !== "function")
|
|
30879
|
-
throw new TypeError('Expected the "verbose" option to be a function');
|
|
30880
|
-
if (nativeBinding != null && typeof nativeBinding !== "string" && typeof nativeBinding !== "object")
|
|
30881
|
-
throw new TypeError('Expected the "nativeBinding" option to be a string or addon object');
|
|
30882
|
-
let addon;
|
|
30883
|
-
if (nativeBinding == null) {
|
|
30884
|
-
addon = DEFAULT_ADDON || (DEFAULT_ADDON = require_bindings()("better_sqlite3.node"));
|
|
30885
|
-
} else if (typeof nativeBinding === "string") {
|
|
30886
|
-
const requireFunc = typeof __non_webpack_require__ === "function" ? __non_webpack_require__ : __require;
|
|
30887
|
-
addon = requireFunc(path.resolve(nativeBinding).replace(/(\.node)?$/, ".node"));
|
|
30888
|
-
} else {
|
|
30889
|
-
addon = nativeBinding;
|
|
30890
|
-
}
|
|
30891
|
-
if (!addon.isInitialized) {
|
|
30892
|
-
addon.setErrorConstructor(SqliteError);
|
|
30893
|
-
addon.isInitialized = true;
|
|
30894
|
-
}
|
|
30895
|
-
if (!anonymous && !filename.startsWith("file:") && !fs.existsSync(path.dirname(filename))) {
|
|
30896
|
-
throw new TypeError("Cannot open database because the directory does not exist");
|
|
30897
|
-
}
|
|
30898
|
-
Object.defineProperties(this, {
|
|
30899
|
-
[util.cppdb]: { value: new addon.Database(filename, filenameGiven, anonymous, readonly, fileMustExist, timeout, verbose || null, buffer || null) },
|
|
30900
|
-
...wrappers.getters
|
|
30901
|
-
});
|
|
30902
|
-
}
|
|
30903
|
-
var wrappers = require_wrappers();
|
|
30904
|
-
Database.prototype.prepare = wrappers.prepare;
|
|
30905
|
-
Database.prototype.transaction = require_transaction();
|
|
30906
|
-
Database.prototype.pragma = require_pragma();
|
|
30907
|
-
Database.prototype.backup = require_backup();
|
|
30908
|
-
Database.prototype.serialize = require_serialize();
|
|
30909
|
-
Database.prototype.function = require_function();
|
|
30910
|
-
Database.prototype.aggregate = require_aggregate();
|
|
30911
|
-
Database.prototype.table = require_table();
|
|
30912
|
-
Database.prototype.loadExtension = wrappers.loadExtension;
|
|
30913
|
-
Database.prototype.exec = wrappers.exec;
|
|
30914
|
-
Database.prototype.close = wrappers.close;
|
|
30915
|
-
Database.prototype.defaultSafeIntegers = wrappers.defaultSafeIntegers;
|
|
30916
|
-
Database.prototype.unsafeMode = wrappers.unsafeMode;
|
|
30917
|
-
Database.prototype[util.inspect] = require_inspect();
|
|
30918
|
-
module.exports = Database;
|
|
30919
|
-
});
|
|
30920
|
-
|
|
30921
|
-
// node_modules/better-sqlite3/lib/index.js
|
|
30922
|
-
var require_lib6 = __commonJS((exports, module) => {
|
|
30923
|
-
module.exports = require_database();
|
|
30924
|
-
module.exports.SqliteError = require_sqlite_error();
|
|
30925
|
-
});
|
|
30926
|
-
|
|
30927
30162
|
// node_modules/tarn/dist/TimeoutError.js
|
|
30928
30163
|
var require_TimeoutError = __commonJS((exports) => {
|
|
30929
30164
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -40628,7 +39863,7 @@ var require_index_browser = __commonJS((exports) => {
|
|
|
40628
39863
|
});
|
|
40629
39864
|
|
|
40630
39865
|
// node_modules/@azure/msal-common/lib/index.cjs
|
|
40631
|
-
var
|
|
39866
|
+
var require_lib6 = __commonJS((exports) => {
|
|
40632
39867
|
/*! @azure/msal-common v15.13.3 2025-12-04 */
|
|
40633
39868
|
var indexNode = require_index_node_4Jss3kYh();
|
|
40634
39869
|
var indexBrowser = require_index_browser();
|
|
@@ -44407,7 +43642,7 @@ var require_msal_node = __commonJS((exports) => {
|
|
|
44407
43642
|
var https = __require("https");
|
|
44408
43643
|
var uuid = require_dist2();
|
|
44409
43644
|
var crypto2 = __require("crypto");
|
|
44410
|
-
var msalCommon =
|
|
43645
|
+
var msalCommon = require_lib6();
|
|
44411
43646
|
var jwt = require_jsonwebtoken();
|
|
44412
43647
|
var fs = __require("fs");
|
|
44413
43648
|
var path = __require("path");
|
|
@@ -54602,7 +53837,7 @@ var require_pipeline = __commonJS((exports) => {
|
|
|
54602
53837
|
});
|
|
54603
53838
|
|
|
54604
53839
|
// node_modules/@typespec/ts-http-runtime/dist/commonjs/util/inspect.js
|
|
54605
|
-
var
|
|
53840
|
+
var require_inspect = __commonJS((exports) => {
|
|
54606
53841
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54607
53842
|
exports.custom = undefined;
|
|
54608
53843
|
var node_util_1 = __require("node:util");
|
|
@@ -54615,7 +53850,7 @@ var require_restError = __commonJS((exports) => {
|
|
|
54615
53850
|
exports.RestError = undefined;
|
|
54616
53851
|
exports.isRestError = isRestError;
|
|
54617
53852
|
var error_js_1 = require_error2();
|
|
54618
|
-
var inspect_js_1 =
|
|
53853
|
+
var inspect_js_1 = require_inspect();
|
|
54619
53854
|
var sanitizer_js_1 = require_sanitizer();
|
|
54620
53855
|
var errorSanitizer = new sanitizer_js_1.Sanitizer;
|
|
54621
53856
|
|
|
@@ -66318,7 +65553,7 @@ var require_primordials = __commonJS((exports, module) => {
|
|
|
66318
65553
|
});
|
|
66319
65554
|
|
|
66320
65555
|
// node_modules/readable-stream/lib/ours/util/inspect.js
|
|
66321
|
-
var
|
|
65556
|
+
var require_inspect2 = __commonJS((exports, module) => {
|
|
66322
65557
|
module.exports = {
|
|
66323
65558
|
format(format2, ...args) {
|
|
66324
65559
|
return format2.replace(/%([sdifj])/g, function(...[_unused, type]) {
|
|
@@ -66367,7 +65602,7 @@ var require_inspect3 = __commonJS((exports, module) => {
|
|
|
66367
65602
|
|
|
66368
65603
|
// node_modules/readable-stream/lib/ours/errors.js
|
|
66369
65604
|
var require_errors4 = __commonJS((exports, module) => {
|
|
66370
|
-
var { format: format2, inspect } =
|
|
65605
|
+
var { format: format2, inspect } = require_inspect2();
|
|
66371
65606
|
var { AggregateError: CustomAggregateError } = require_primordials();
|
|
66372
65607
|
var AggregateError2 = globalThis.AggregateError || CustomAggregateError;
|
|
66373
65608
|
var kIsNodeError = Symbol("kIsNodeError");
|
|
@@ -67175,9 +66410,9 @@ var require_abort_controller = __commonJS((exports, module) => {
|
|
|
67175
66410
|
});
|
|
67176
66411
|
|
|
67177
66412
|
// node_modules/readable-stream/lib/ours/util.js
|
|
67178
|
-
var
|
|
66413
|
+
var require_util = __commonJS((exports, module) => {
|
|
67179
66414
|
var bufferModule = __require("buffer");
|
|
67180
|
-
var { format: format2, inspect } =
|
|
66415
|
+
var { format: format2, inspect } = require_inspect2();
|
|
67181
66416
|
var {
|
|
67182
66417
|
codes: { ERR_INVALID_ARG_TYPE }
|
|
67183
66418
|
} = require_errors4();
|
|
@@ -67326,8 +66561,8 @@ var require_validators = __commonJS((exports, module) => {
|
|
|
67326
66561
|
hideStackFrames,
|
|
67327
66562
|
codes: { ERR_SOCKET_BAD_PORT, ERR_INVALID_ARG_TYPE, ERR_INVALID_ARG_VALUE, ERR_OUT_OF_RANGE, ERR_UNKNOWN_SIGNAL }
|
|
67328
66563
|
} = require_errors4();
|
|
67329
|
-
var { normalizeEncoding } =
|
|
67330
|
-
var { isAsyncFunction, isArrayBufferView } =
|
|
66564
|
+
var { normalizeEncoding } = require_util();
|
|
66565
|
+
var { isAsyncFunction, isArrayBufferView } = require_util().types;
|
|
67331
66566
|
var signals2 = {};
|
|
67332
66567
|
function isInt32(value) {
|
|
67333
66568
|
return value === (value | 0);
|
|
@@ -67800,7 +67035,7 @@ var require_end_of_stream = __commonJS((exports, module) => {
|
|
|
67800
67035
|
var process15 = require_process();
|
|
67801
67036
|
var { AbortError, codes } = require_errors4();
|
|
67802
67037
|
var { ERR_INVALID_ARG_TYPE, ERR_STREAM_PREMATURE_CLOSE } = codes;
|
|
67803
|
-
var { kEmptyObject, once } =
|
|
67038
|
+
var { kEmptyObject, once } = require_util();
|
|
67804
67039
|
var { validateAbortSignal, validateFunction, validateObject, validateBoolean } = require_validators();
|
|
67805
67040
|
var { Promise: Promise2, PromisePrototypeThen, SymbolDispose } = require_primordials();
|
|
67806
67041
|
var {
|
|
@@ -67972,7 +67207,7 @@ var require_end_of_stream = __commonJS((exports, module) => {
|
|
|
67972
67207
|
if (options.signal.aborted) {
|
|
67973
67208
|
process15.nextTick(abort);
|
|
67974
67209
|
} else {
|
|
67975
|
-
addAbortListener = addAbortListener ||
|
|
67210
|
+
addAbortListener = addAbortListener || require_util().addAbortListener;
|
|
67976
67211
|
const disposable = addAbortListener(options.signal, abort);
|
|
67977
67212
|
const originalCallback = callback;
|
|
67978
67213
|
callback = once((...args) => {
|
|
@@ -67996,7 +67231,7 @@ var require_end_of_stream = __commonJS((exports, module) => {
|
|
|
67996
67231
|
if (options.signal.aborted) {
|
|
67997
67232
|
process15.nextTick(abort);
|
|
67998
67233
|
} else {
|
|
67999
|
-
addAbortListener = addAbortListener ||
|
|
67234
|
+
addAbortListener = addAbortListener || require_util().addAbortListener;
|
|
68000
67235
|
const disposable = addAbortListener(options.signal, abort);
|
|
68001
67236
|
const originalCallback = callback;
|
|
68002
67237
|
callback = once((...args) => {
|
|
@@ -68420,7 +67655,7 @@ var require_add_abort_signal = __commonJS((exports, module) => {
|
|
|
68420
67655
|
if (signal.aborted) {
|
|
68421
67656
|
onAbort();
|
|
68422
67657
|
} else {
|
|
68423
|
-
addAbortListener = addAbortListener ||
|
|
67658
|
+
addAbortListener = addAbortListener || require_util().addAbortListener;
|
|
68424
67659
|
const disposable = addAbortListener(signal, onAbort);
|
|
68425
67660
|
eos(stream, disposable[SymbolDispose]);
|
|
68426
67661
|
}
|
|
@@ -68432,7 +67667,7 @@ var require_add_abort_signal = __commonJS((exports, module) => {
|
|
|
68432
67667
|
var require_buffer_list = __commonJS((exports, module) => {
|
|
68433
67668
|
var { StringPrototypeSlice, SymbolIterator, TypedArrayPrototypeSet, Uint8Array: Uint8Array2 } = require_primordials();
|
|
68434
67669
|
var { Buffer: Buffer3 } = __require("buffer");
|
|
68435
|
-
var { inspect } =
|
|
67670
|
+
var { inspect } = require_util();
|
|
68436
67671
|
module.exports = class BufferList {
|
|
68437
67672
|
constructor() {
|
|
68438
67673
|
this.head = null;
|
|
@@ -68993,7 +68228,7 @@ var require_readable = __commonJS((exports, module) => {
|
|
|
68993
68228
|
var { Buffer: Buffer3 } = __require("buffer");
|
|
68994
68229
|
var { addAbortSignal } = require_add_abort_signal();
|
|
68995
68230
|
var eos = require_end_of_stream();
|
|
68996
|
-
var debug =
|
|
68231
|
+
var debug = require_util().debuglog("stream", (fn) => {
|
|
68997
68232
|
debug = fn;
|
|
68998
68233
|
});
|
|
68999
68234
|
var BufferList = require_buffer_list();
|
|
@@ -70609,7 +69844,7 @@ var require_duplexify = __commonJS((exports, module) => {
|
|
|
70609
69844
|
var Duplex = require_duplex();
|
|
70610
69845
|
var Readable = require_readable();
|
|
70611
69846
|
var Writable = require_writable();
|
|
70612
|
-
var { createDeferredPromise } =
|
|
69847
|
+
var { createDeferredPromise } = require_util();
|
|
70613
69848
|
var from = require_from();
|
|
70614
69849
|
var Blob2 = globalThis.Blob || bufferModule.Blob;
|
|
70615
69850
|
var isBlob = typeof Blob2 !== "undefined" ? function isBlob(b) {
|
|
@@ -71145,7 +70380,7 @@ var require_pipeline4 = __commonJS((exports, module) => {
|
|
|
71145
70380
|
var process15 = require_process();
|
|
71146
70381
|
var { ArrayIsArray, Promise: Promise2, SymbolAsyncIterator, SymbolDispose } = require_primordials();
|
|
71147
70382
|
var eos = require_end_of_stream();
|
|
71148
|
-
var { once } =
|
|
70383
|
+
var { once } = require_util();
|
|
71149
70384
|
var destroyImpl = require_destroy();
|
|
71150
70385
|
var Duplex = require_duplex();
|
|
71151
70386
|
var {
|
|
@@ -71306,7 +70541,7 @@ var require_pipeline4 = __commonJS((exports, module) => {
|
|
|
71306
70541
|
function abort() {
|
|
71307
70542
|
finishImpl(new AbortError);
|
|
71308
70543
|
}
|
|
71309
|
-
addAbortListener = addAbortListener ||
|
|
70544
|
+
addAbortListener = addAbortListener || require_util().addAbortListener;
|
|
71310
70545
|
let disposable;
|
|
71311
70546
|
if (outerSignal) {
|
|
71312
70547
|
disposable = addAbortListener(outerSignal, abort);
|
|
@@ -71738,7 +70973,7 @@ var require_operators = __commonJS((exports, module) => {
|
|
|
71738
70973
|
var staticCompose = require_compose();
|
|
71739
70974
|
var { addAbortSignalNoValidate } = require_add_abort_signal();
|
|
71740
70975
|
var { isWritable, isNodeStream } = require_utils9();
|
|
71741
|
-
var { deprecate } =
|
|
70976
|
+
var { deprecate } = require_util();
|
|
71742
70977
|
var {
|
|
71743
70978
|
ArrayPrototypePush,
|
|
71744
70979
|
Boolean: Boolean2,
|
|
@@ -71791,7 +71026,7 @@ var require_operators = __commonJS((exports, module) => {
|
|
|
71791
71026
|
validateInteger(highWaterMark, "options.highWaterMark", 0);
|
|
71792
71027
|
highWaterMark += concurrency;
|
|
71793
71028
|
return async function* map() {
|
|
71794
|
-
const signal =
|
|
71029
|
+
const signal = require_util().AbortSignalAny([options === null || options === undefined ? undefined : options.signal].filter(Boolean2));
|
|
71795
71030
|
const stream = this;
|
|
71796
71031
|
const queue = [];
|
|
71797
71032
|
const signalOpt = {
|
|
@@ -72162,7 +71397,7 @@ var require_stream2 = __commonJS((exports, module) => {
|
|
|
72162
71397
|
var { ObjectDefineProperty: ObjectDefineProperty2, ObjectKeys, ReflectApply } = require_primordials();
|
|
72163
71398
|
var {
|
|
72164
71399
|
promisify: { custom: customPromisify }
|
|
72165
|
-
} =
|
|
71400
|
+
} = require_util();
|
|
72166
71401
|
var { streamReturningOperators, promiseReturningOperators } = require_operators();
|
|
72167
71402
|
var {
|
|
72168
71403
|
codes: { ERR_ILLEGAL_CONSTRUCTOR }
|
|
@@ -88101,7 +87336,7 @@ var require_streams2 = __commonJS((exports, module) => {
|
|
|
88101
87336
|
});
|
|
88102
87337
|
|
|
88103
87338
|
// node_modules/tedious/node_modules/iconv-lite/lib/index.js
|
|
88104
|
-
var
|
|
87339
|
+
var require_lib7 = __commonJS((exports, module) => {
|
|
88105
87340
|
var Buffer3 = require_safer().Buffer;
|
|
88106
87341
|
var bomHandling = require_bom_handling2();
|
|
88107
87342
|
var iconv = exports;
|
|
@@ -88220,7 +87455,7 @@ var require_text = __commonJS((exports, module) => {
|
|
|
88220
87455
|
value: true
|
|
88221
87456
|
});
|
|
88222
87457
|
exports.default = undefined;
|
|
88223
|
-
var _iconvLite = _interopRequireDefault(
|
|
87458
|
+
var _iconvLite = _interopRequireDefault(require_lib7());
|
|
88224
87459
|
function _interopRequireDefault(obj) {
|
|
88225
87460
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
88226
87461
|
}
|
|
@@ -88552,7 +87787,7 @@ var require_varchar = __commonJS((exports, module) => {
|
|
|
88552
87787
|
value: true
|
|
88553
87788
|
});
|
|
88554
87789
|
exports.default = undefined;
|
|
88555
|
-
var _iconvLite = _interopRequireDefault(
|
|
87790
|
+
var _iconvLite = _interopRequireDefault(require_lib7());
|
|
88556
87791
|
function _interopRequireDefault(obj) {
|
|
88557
87792
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
88558
87793
|
}
|
|
@@ -88735,7 +87970,7 @@ var require_char = __commonJS((exports, module) => {
|
|
|
88735
87970
|
value: true
|
|
88736
87971
|
});
|
|
88737
87972
|
exports.default = undefined;
|
|
88738
|
-
var _iconvLite = _interopRequireDefault(
|
|
87973
|
+
var _iconvLite = _interopRequireDefault(require_lib7());
|
|
88739
87974
|
function _interopRequireDefault(obj) {
|
|
88740
87975
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
88741
87976
|
}
|
|
@@ -91064,7 +90299,7 @@ var require_value_parser = __commonJS((exports, module) => {
|
|
|
91064
90299
|
exports.readValue = readValue;
|
|
91065
90300
|
var _metadataParser = require_metadata_parser();
|
|
91066
90301
|
var _dataType = require_data_type();
|
|
91067
|
-
var _iconvLite = _interopRequireDefault(
|
|
90302
|
+
var _iconvLite = _interopRequireDefault(require_lib7());
|
|
91068
90303
|
var _sprintfJs = require_sprintf();
|
|
91069
90304
|
var _guidParser = require_guid_parser();
|
|
91070
90305
|
var _helpers = require_helpers4();
|
|
@@ -91818,7 +91053,7 @@ var require_returnvalue_token_parser = __commonJS((exports, module) => {
|
|
|
91818
91053
|
var _metadataParser = require_metadata_parser();
|
|
91819
91054
|
var _valueParser = require_value_parser();
|
|
91820
91055
|
var _helpers = require_helpers4();
|
|
91821
|
-
var iconv = _interopRequireWildcard(
|
|
91056
|
+
var iconv = _interopRequireWildcard(require_lib7());
|
|
91822
91057
|
function _getRequireWildcardCache(e) {
|
|
91823
91058
|
if (typeof WeakMap != "function")
|
|
91824
91059
|
return null;
|
|
@@ -91929,7 +91164,7 @@ var require_row_token_parser = __commonJS((exports, module) => {
|
|
|
91929
91164
|
});
|
|
91930
91165
|
exports.default = undefined;
|
|
91931
91166
|
var _token = require_token();
|
|
91932
|
-
var iconv = _interopRequireWildcard(
|
|
91167
|
+
var iconv = _interopRequireWildcard(require_lib7());
|
|
91933
91168
|
var _valueParser = require_value_parser();
|
|
91934
91169
|
var _helpers = require_helpers4();
|
|
91935
91170
|
function _getRequireWildcardCache(e) {
|
|
@@ -92027,7 +91262,7 @@ var require_nbcrow_token_parser = __commonJS((exports, module) => {
|
|
|
92027
91262
|
});
|
|
92028
91263
|
exports.default = undefined;
|
|
92029
91264
|
var _token = require_token();
|
|
92030
|
-
var iconv = _interopRequireWildcard(
|
|
91265
|
+
var iconv = _interopRequireWildcard(require_lib7());
|
|
92031
91266
|
var _valueParser = require_value_parser();
|
|
92032
91267
|
var _helpers = require_helpers4();
|
|
92033
91268
|
function _getRequireWildcardCache(e) {
|
|
@@ -92557,7 +91792,7 @@ var require_token_stream_parser = __commonJS((exports) => {
|
|
|
92557
91792
|
});
|
|
92558
91793
|
|
|
92559
91794
|
// node_modules/tedious/lib/transaction.js
|
|
92560
|
-
var
|
|
91795
|
+
var require_transaction = __commonJS((exports) => {
|
|
92561
91796
|
Object.defineProperty(exports, "__esModule", {
|
|
92562
91797
|
value: true
|
|
92563
91798
|
});
|
|
@@ -93548,7 +92783,7 @@ var require_connection5 = __commonJS((exports, module) => {
|
|
|
93548
92783
|
var _sqlbatchPayload = _interopRequireDefault(require_sqlbatch_payload());
|
|
93549
92784
|
var _messageIo = _interopRequireDefault(require_message_io());
|
|
93550
92785
|
var _tokenStreamParser = require_token_stream_parser();
|
|
93551
|
-
var _transaction =
|
|
92786
|
+
var _transaction = require_transaction();
|
|
93552
92787
|
var _errors = require_errors3();
|
|
93553
92788
|
var _connector = require_connector();
|
|
93554
92789
|
var _library = require_library();
|
|
@@ -95623,7 +94858,7 @@ var require_tedious = __commonJS((exports) => {
|
|
|
95623
94858
|
var _library = require_library();
|
|
95624
94859
|
var _errors = require_errors3();
|
|
95625
94860
|
var _dataType = require_data_type();
|
|
95626
|
-
var _transaction =
|
|
94861
|
+
var _transaction = require_transaction();
|
|
95627
94862
|
var _tdsVersions = require_tds_versions();
|
|
95628
94863
|
function _interopRequireDefault(obj) {
|
|
95629
94864
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
@@ -96106,7 +95341,7 @@ var require_builder = __commonJS((exports) => {
|
|
|
96106
95341
|
});
|
|
96107
95342
|
|
|
96108
95343
|
// node_modules/@tediousjs/connection-string/lib/index.js
|
|
96109
|
-
var
|
|
95344
|
+
var require_lib8 = __commonJS((exports) => {
|
|
96110
95345
|
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
96111
95346
|
if (k2 === undefined)
|
|
96112
95347
|
k2 = k;
|
|
@@ -110411,8 +109646,8 @@ function toCamelCase(str) {
|
|
|
110411
109646
|
}
|
|
110412
109647
|
|
|
110413
109648
|
// src/transform/table.ts
|
|
110414
|
-
function transformTable(table, enums, enumResolver, mapType, options, unknownTypes) {
|
|
110415
|
-
const properties = table.columns.map((column) => transformColumn(column, enums, enumResolver, mapType, options, unknownTypes));
|
|
109649
|
+
function transformTable(table, enums, enumResolver, mapType, options, unknownTypes, usedHelpers) {
|
|
109650
|
+
const properties = table.columns.map((column) => transformColumn(column, enums, enumResolver, mapType, options, unknownTypes, usedHelpers));
|
|
110416
109651
|
return {
|
|
110417
109652
|
kind: "interface",
|
|
110418
109653
|
name: toPascalCase(singularize(table.name)),
|
|
@@ -110420,7 +109655,7 @@ function transformTable(table, enums, enumResolver, mapType, options, unknownTyp
|
|
|
110420
109655
|
exported: true
|
|
110421
109656
|
};
|
|
110422
109657
|
}
|
|
110423
|
-
function transformColumn(column, enums, enumResolver, mapType, options, unknownTypes) {
|
|
109658
|
+
function transformColumn(column, enums, enumResolver, mapType, options, unknownTypes, usedHelpers) {
|
|
110424
109659
|
const matchingEnum = enums.find((e) => e.name === column.dataType && e.schema === (column.dataTypeSchema ?? "public"));
|
|
110425
109660
|
let type;
|
|
110426
109661
|
if (matchingEnum) {
|
|
@@ -110436,7 +109671,8 @@ function transformColumn(column, enums, enumResolver, mapType, options, unknownT
|
|
|
110436
109671
|
type = mapType(column.dataType, {
|
|
110437
109672
|
isNullable: column.isNullable,
|
|
110438
109673
|
isArray: column.isArray,
|
|
110439
|
-
unknownTypes
|
|
109674
|
+
unknownTypes,
|
|
109675
|
+
usedHelpers
|
|
110440
109676
|
});
|
|
110441
109677
|
}
|
|
110442
109678
|
if (column.isAutoIncrement || column.hasDefaultValue) {
|
|
@@ -110773,25 +110009,15 @@ function parsePostgresArray(value) {
|
|
|
110773
110009
|
}
|
|
110774
110010
|
|
|
110775
110011
|
// src/dialects/postgres/type-mapper.ts
|
|
110776
|
-
function
|
|
110777
|
-
|
|
110778
|
-
|
|
110779
|
-
typeArguments.push(insertType);
|
|
110780
|
-
if (updateType) {
|
|
110781
|
-
typeArguments.push(updateType);
|
|
110782
|
-
}
|
|
110783
|
-
}
|
|
110784
|
-
return {
|
|
110785
|
-
kind: "generic",
|
|
110786
|
-
name: "ColumnType",
|
|
110787
|
-
typeArguments
|
|
110788
|
-
};
|
|
110012
|
+
function helper(name, options) {
|
|
110013
|
+
options.usedHelpers?.add(name);
|
|
110014
|
+
return { kind: "reference", name };
|
|
110789
110015
|
}
|
|
110790
110016
|
function mapPostgresType(dataType, options) {
|
|
110791
110017
|
const { isNullable, isArray, unknownTypes } = options;
|
|
110792
110018
|
if (isArray || dataType.endsWith("[]")) {
|
|
110793
110019
|
const baseTypeName = dataType.endsWith("[]") ? dataType.slice(0, -2) : dataType;
|
|
110794
|
-
const elementType = mapPostgresType(baseTypeName, { isNullable: false, isArray: false, unknownTypes });
|
|
110020
|
+
const elementType = mapPostgresType(baseTypeName, { isNullable: false, isArray: false, unknownTypes, usedHelpers: options.usedHelpers });
|
|
110795
110021
|
const isSimple = elementType.kind === "primitive" && ["boolean", "number", "string"].includes(elementType.value);
|
|
110796
110022
|
let arrayType;
|
|
110797
110023
|
if (isSimple) {
|
|
@@ -110817,21 +110043,7 @@ function mapPostgresType(dataType, options) {
|
|
|
110817
110043
|
break;
|
|
110818
110044
|
case "int8":
|
|
110819
110045
|
case "bigint":
|
|
110820
|
-
baseType =
|
|
110821
|
-
kind: "union",
|
|
110822
|
-
types: [
|
|
110823
|
-
{ kind: "primitive", value: "string" },
|
|
110824
|
-
{ kind: "primitive", value: "number" },
|
|
110825
|
-
{ kind: "primitive", value: "bigint" }
|
|
110826
|
-
]
|
|
110827
|
-
}, {
|
|
110828
|
-
kind: "union",
|
|
110829
|
-
types: [
|
|
110830
|
-
{ kind: "primitive", value: "string" },
|
|
110831
|
-
{ kind: "primitive", value: "number" },
|
|
110832
|
-
{ kind: "primitive", value: "bigint" }
|
|
110833
|
-
]
|
|
110834
|
-
});
|
|
110046
|
+
baseType = helper("Int8", options);
|
|
110835
110047
|
break;
|
|
110836
110048
|
case "float4":
|
|
110837
110049
|
case "float8":
|
|
@@ -110841,19 +110053,7 @@ function mapPostgresType(dataType, options) {
|
|
|
110841
110053
|
break;
|
|
110842
110054
|
case "numeric":
|
|
110843
110055
|
case "decimal":
|
|
110844
|
-
baseType =
|
|
110845
|
-
kind: "union",
|
|
110846
|
-
types: [
|
|
110847
|
-
{ kind: "primitive", value: "number" },
|
|
110848
|
-
{ kind: "primitive", value: "string" }
|
|
110849
|
-
]
|
|
110850
|
-
}, {
|
|
110851
|
-
kind: "union",
|
|
110852
|
-
types: [
|
|
110853
|
-
{ kind: "primitive", value: "number" },
|
|
110854
|
-
{ kind: "primitive", value: "string" }
|
|
110855
|
-
]
|
|
110856
|
-
});
|
|
110056
|
+
baseType = helper("Numeric", options);
|
|
110857
110057
|
break;
|
|
110858
110058
|
case "varchar":
|
|
110859
110059
|
case "char":
|
|
@@ -110869,38 +110069,14 @@ function mapPostgresType(dataType, options) {
|
|
|
110869
110069
|
case "timestamp":
|
|
110870
110070
|
case "timestamptz":
|
|
110871
110071
|
case "date":
|
|
110872
|
-
baseType =
|
|
110873
|
-
kind: "union",
|
|
110874
|
-
types: [
|
|
110875
|
-
{ kind: "primitive", value: "Date" },
|
|
110876
|
-
{ kind: "primitive", value: "string" }
|
|
110877
|
-
]
|
|
110878
|
-
}, {
|
|
110879
|
-
kind: "union",
|
|
110880
|
-
types: [
|
|
110881
|
-
{ kind: "primitive", value: "Date" },
|
|
110882
|
-
{ kind: "primitive", value: "string" }
|
|
110883
|
-
]
|
|
110884
|
-
});
|
|
110072
|
+
baseType = helper("Timestamp", options);
|
|
110885
110073
|
break;
|
|
110886
110074
|
case "time":
|
|
110887
110075
|
case "timetz":
|
|
110888
110076
|
baseType = { kind: "primitive", value: "string" };
|
|
110889
110077
|
break;
|
|
110890
110078
|
case "interval":
|
|
110891
|
-
baseType =
|
|
110892
|
-
kind: "union",
|
|
110893
|
-
types: [
|
|
110894
|
-
{ kind: "reference", name: "IPostgresInterval" },
|
|
110895
|
-
{ kind: "primitive", value: "string" }
|
|
110896
|
-
]
|
|
110897
|
-
}, {
|
|
110898
|
-
kind: "union",
|
|
110899
|
-
types: [
|
|
110900
|
-
{ kind: "reference", name: "IPostgresInterval" },
|
|
110901
|
-
{ kind: "primitive", value: "string" }
|
|
110902
|
-
]
|
|
110903
|
-
});
|
|
110079
|
+
baseType = helper("Interval", options);
|
|
110904
110080
|
break;
|
|
110905
110081
|
case "money":
|
|
110906
110082
|
baseType = { kind: "primitive", value: "string" };
|
|
@@ -110912,6 +110088,12 @@ function mapPostgresType(dataType, options) {
|
|
|
110912
110088
|
case "bytea":
|
|
110913
110089
|
baseType = { kind: "primitive", value: "Buffer" };
|
|
110914
110090
|
break;
|
|
110091
|
+
case "point":
|
|
110092
|
+
baseType = helper("Point", options);
|
|
110093
|
+
break;
|
|
110094
|
+
case "circle":
|
|
110095
|
+
baseType = helper("Circle", options);
|
|
110096
|
+
break;
|
|
110915
110097
|
case "int4range":
|
|
110916
110098
|
case "int8range":
|
|
110917
110099
|
case "numrange":
|
|
@@ -111119,7 +110301,7 @@ function extractEnums(tables) {
|
|
|
111119
110301
|
}
|
|
111120
110302
|
|
|
111121
110303
|
// src/dialects/mysql/type-mapper.ts
|
|
111122
|
-
function
|
|
110304
|
+
function createColumnType(selectType, insertType, updateType) {
|
|
111123
110305
|
const typeArguments = [selectType];
|
|
111124
110306
|
if (insertType) {
|
|
111125
110307
|
typeArguments.push(insertType);
|
|
@@ -111147,7 +110329,7 @@ function mapMysqlType(dataType, options) {
|
|
|
111147
110329
|
baseType = { kind: "primitive", value: "number" };
|
|
111148
110330
|
break;
|
|
111149
110331
|
case "bigint":
|
|
111150
|
-
baseType =
|
|
110332
|
+
baseType = createColumnType({ kind: "primitive", value: "string" }, {
|
|
111151
110333
|
kind: "union",
|
|
111152
110334
|
types: [
|
|
111153
110335
|
{ kind: "primitive", value: "string" },
|
|
@@ -111170,7 +110352,7 @@ function mapMysqlType(dataType, options) {
|
|
|
111170
110352
|
break;
|
|
111171
110353
|
case "decimal":
|
|
111172
110354
|
case "numeric":
|
|
111173
|
-
baseType =
|
|
110355
|
+
baseType = createColumnType({ kind: "primitive", value: "string" }, {
|
|
111174
110356
|
kind: "union",
|
|
111175
110357
|
types: [
|
|
111176
110358
|
{ kind: "primitive", value: "number" },
|
|
@@ -111206,7 +110388,7 @@ function mapMysqlType(dataType, options) {
|
|
|
111206
110388
|
case "date":
|
|
111207
110389
|
case "datetime":
|
|
111208
110390
|
case "timestamp":
|
|
111209
|
-
baseType =
|
|
110391
|
+
baseType = createColumnType({ kind: "primitive", value: "Date" }, {
|
|
111210
110392
|
kind: "union",
|
|
111211
110393
|
types: [
|
|
111212
110394
|
{ kind: "primitive", value: "Date" },
|
|
@@ -111409,7 +110591,7 @@ function mapSqliteType(dataType, options) {
|
|
|
111409
110591
|
class SqliteDialect2 {
|
|
111410
110592
|
name = "sqlite";
|
|
111411
110593
|
async createKyselyDialect(connectionString) {
|
|
111412
|
-
const Database = await
|
|
110594
|
+
const Database = await import("better-sqlite3").then((m) => m.default);
|
|
111413
110595
|
return new SqliteDialect({
|
|
111414
110596
|
database: new Database(connectionString)
|
|
111415
110597
|
});
|
|
@@ -111633,7 +110815,7 @@ class MssqlDialect2 {
|
|
|
111633
110815
|
};
|
|
111634
110816
|
}
|
|
111635
110817
|
async parseAdoNetFormat(connectionString) {
|
|
111636
|
-
const { parseConnectionString } = await Promise.resolve().then(() => __toESM(
|
|
110818
|
+
const { parseConnectionString } = await Promise.resolve().then(() => __toESM(require_lib8(), 1));
|
|
111637
110819
|
const parsed = parseConnectionString(connectionString);
|
|
111638
110820
|
const serverValue = parsed.server || parsed["data source"] || "localhost";
|
|
111639
110821
|
const tokens = serverValue.split(",");
|
|
@@ -111668,10 +110850,71 @@ function getDialect(name) {
|
|
|
111668
110850
|
}
|
|
111669
110851
|
}
|
|
111670
110852
|
|
|
110853
|
+
// src/dialects/postgres/helpers.ts
|
|
110854
|
+
function createColumnType2(selectType, insertType, updateType) {
|
|
110855
|
+
return {
|
|
110856
|
+
kind: "generic",
|
|
110857
|
+
name: "ColumnType",
|
|
110858
|
+
typeArguments: [selectType, insertType, updateType]
|
|
110859
|
+
};
|
|
110860
|
+
}
|
|
110861
|
+
function createUnion(...types2) {
|
|
110862
|
+
return { kind: "union", types: types2 };
|
|
110863
|
+
}
|
|
110864
|
+
function primitive(value) {
|
|
110865
|
+
if (value === "Date") {
|
|
110866
|
+
return { kind: "reference", name: "Date" };
|
|
110867
|
+
}
|
|
110868
|
+
return { kind: "primitive", value };
|
|
110869
|
+
}
|
|
110870
|
+
function ref(name) {
|
|
110871
|
+
return { kind: "reference", name };
|
|
110872
|
+
}
|
|
110873
|
+
var HELPER_DEFINITIONS = {
|
|
110874
|
+
Timestamp: {
|
|
110875
|
+
kind: "typeAlias",
|
|
110876
|
+
name: "Timestamp",
|
|
110877
|
+
exported: true,
|
|
110878
|
+
type: createColumnType2(primitive("Date"), createUnion(primitive("Date"), primitive("string")), createUnion(primitive("Date"), primitive("string")))
|
|
110879
|
+
},
|
|
110880
|
+
Int8: {
|
|
110881
|
+
kind: "typeAlias",
|
|
110882
|
+
name: "Int8",
|
|
110883
|
+
exported: true,
|
|
110884
|
+
type: createColumnType2(primitive("string"), createUnion(primitive("string"), primitive("number"), primitive("bigint")), createUnion(primitive("string"), primitive("number"), primitive("bigint")))
|
|
110885
|
+
},
|
|
110886
|
+
Numeric: {
|
|
110887
|
+
kind: "typeAlias",
|
|
110888
|
+
name: "Numeric",
|
|
110889
|
+
exported: true,
|
|
110890
|
+
type: createColumnType2(primitive("string"), createUnion(primitive("number"), primitive("string")), createUnion(primitive("number"), primitive("string")))
|
|
110891
|
+
},
|
|
110892
|
+
Interval: {
|
|
110893
|
+
kind: "typeAlias",
|
|
110894
|
+
name: "Interval",
|
|
110895
|
+
exported: true,
|
|
110896
|
+
type: createColumnType2(ref("IPostgresInterval"), createUnion(ref("IPostgresInterval"), primitive("string")), createUnion(ref("IPostgresInterval"), primitive("string")))
|
|
110897
|
+
},
|
|
110898
|
+
Point: {
|
|
110899
|
+
kind: "typeAlias",
|
|
110900
|
+
name: "Point",
|
|
110901
|
+
exported: true,
|
|
110902
|
+
type: { kind: "raw", value: "{ x: number; y: number }" }
|
|
110903
|
+
},
|
|
110904
|
+
Circle: {
|
|
110905
|
+
kind: "typeAlias",
|
|
110906
|
+
name: "Circle",
|
|
110907
|
+
exported: true,
|
|
110908
|
+
type: { kind: "raw", value: "{ x: number; y: number; radius: number }" }
|
|
110909
|
+
}
|
|
110910
|
+
};
|
|
110911
|
+
var HELPER_NAMES = Object.keys(HELPER_DEFINITIONS);
|
|
110912
|
+
|
|
111671
110913
|
// src/transform/index.ts
|
|
111672
110914
|
function transformDatabase(metadata, options) {
|
|
111673
110915
|
const declarations = [];
|
|
111674
110916
|
const unknownTypes = new Set;
|
|
110917
|
+
const usedHelpers = new Set;
|
|
111675
110918
|
const dialectName = options?.dialectName ?? "postgres";
|
|
111676
110919
|
const dialect = getDialect(dialectName);
|
|
111677
110920
|
const mapType = options?.mapType ?? ((dataType, opts) => dialect.mapType(dataType, opts));
|
|
@@ -111759,22 +111002,6 @@ function transformDatabase(metadata, options) {
|
|
|
111759
111002
|
},
|
|
111760
111003
|
exported: true
|
|
111761
111004
|
});
|
|
111762
|
-
if (dialectName === "postgres") {
|
|
111763
|
-
declarations.push({
|
|
111764
|
-
kind: "interface",
|
|
111765
|
-
name: "IPostgresInterval",
|
|
111766
|
-
properties: [
|
|
111767
|
-
{ name: "years", type: { kind: "primitive", value: "number" }, optional: true },
|
|
111768
|
-
{ name: "months", type: { kind: "primitive", value: "number" }, optional: true },
|
|
111769
|
-
{ name: "days", type: { kind: "primitive", value: "number" }, optional: true },
|
|
111770
|
-
{ name: "hours", type: { kind: "primitive", value: "number" }, optional: true },
|
|
111771
|
-
{ name: "minutes", type: { kind: "primitive", value: "number" }, optional: true },
|
|
111772
|
-
{ name: "seconds", type: { kind: "primitive", value: "number" }, optional: true },
|
|
111773
|
-
{ name: "milliseconds", type: { kind: "primitive", value: "number" }, optional: true }
|
|
111774
|
-
],
|
|
111775
|
-
exported: true
|
|
111776
|
-
});
|
|
111777
|
-
}
|
|
111778
111005
|
if (dialectName === "mysql") {
|
|
111779
111006
|
declarations.push({
|
|
111780
111007
|
kind: "interface",
|
|
@@ -111818,7 +111045,31 @@ function transformDatabase(metadata, options) {
|
|
|
111818
111045
|
const filteredTables = filterTables(metadata.tables, options);
|
|
111819
111046
|
const tableInterfaces = [];
|
|
111820
111047
|
for (const table of filteredTables) {
|
|
111821
|
-
tableInterfaces.push(transformTable(table, metadata.enums, enumResolver, mapType, options, unknownTypes));
|
|
111048
|
+
tableInterfaces.push(transformTable(table, metadata.enums, enumResolver, mapType, options, unknownTypes, usedHelpers));
|
|
111049
|
+
}
|
|
111050
|
+
if (dialectName === "postgres") {
|
|
111051
|
+
if (usedHelpers.has("Interval")) {
|
|
111052
|
+
declarations.push({
|
|
111053
|
+
kind: "interface",
|
|
111054
|
+
name: "IPostgresInterval",
|
|
111055
|
+
properties: [
|
|
111056
|
+
{ name: "years", type: { kind: "primitive", value: "number" }, optional: true },
|
|
111057
|
+
{ name: "months", type: { kind: "primitive", value: "number" }, optional: true },
|
|
111058
|
+
{ name: "days", type: { kind: "primitive", value: "number" }, optional: true },
|
|
111059
|
+
{ name: "hours", type: { kind: "primitive", value: "number" }, optional: true },
|
|
111060
|
+
{ name: "minutes", type: { kind: "primitive", value: "number" }, optional: true },
|
|
111061
|
+
{ name: "seconds", type: { kind: "primitive", value: "number" }, optional: true },
|
|
111062
|
+
{ name: "milliseconds", type: { kind: "primitive", value: "number" }, optional: true }
|
|
111063
|
+
],
|
|
111064
|
+
exported: true
|
|
111065
|
+
});
|
|
111066
|
+
}
|
|
111067
|
+
const helperOrder = ["Timestamp", "Int8", "Numeric", "Interval", "Point", "Circle"];
|
|
111068
|
+
for (const name of helperOrder) {
|
|
111069
|
+
if (usedHelpers.has(name)) {
|
|
111070
|
+
declarations.push(HELPER_DEFINITIONS[name]);
|
|
111071
|
+
}
|
|
111072
|
+
}
|
|
111822
111073
|
}
|
|
111823
111074
|
declarations.push(...tableInterfaces);
|
|
111824
111075
|
declarations.push(createDBInterface(filteredTables, options));
|