Commit iniziale

This commit is contained in:
Paolo A
2025-02-18 22:59:07 +00:00
commit 4bbf35cefb
6879 changed files with 623784 additions and 0 deletions

61
node_modules/tedious/benchmarks/bulk-load/iterable.js generated vendored Normal file
View File

@@ -0,0 +1,61 @@
// @ts-check
const { createBenchmark, createConnection } = require('../common');
const { Request, TYPES } = require('tedious');
const bench = createBenchmark(main, {
n: [10, 100],
size: [
10,
100,
1000,
10000
]
});
function main({ n, size }) {
createConnection((connection) => {
const request = new Request(`
CREATE TABLE "#tmpTestTable" (
"id" int NOT NULL
)
`, (err) => {
if (err) {
throw err;
}
let i = 0;
bench.start();
(function cb() {
const bulkLoad = connection.newBulkLoad('#tmpTestTable', (err) => {
if (err) {
throw err;
}
if (i++ === n) {
bench.end(n);
connection.close();
return;
}
cb();
});
bulkLoad.addColumn('id', TYPES.Int, { nullable: false });
const rows = [];
for (let j = 0; j < size; j++) {
rows.push([ j ]);
}
connection.execBulkLoad(bulkLoad, rows);
})();
});
connection.execSqlBatch(request);
});
}