dbtour-source-mssql 0.8.0 → 0.9.0
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/index.js +6 -3
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -68,12 +68,15 @@ export async function run(config, text, options) {
|
|
|
68
68
|
if (!rows.add(row))
|
|
69
69
|
cancel();
|
|
70
70
|
});
|
|
71
|
-
// A cancel ends in an error the driver raises; it is only a failure when dbtour did not ask for it.
|
|
71
|
+
// A cancel ends in an error the driver raises; it is only a failure when dbtour did not ask for it. The
|
|
72
|
+
// error comes before the request has finished, and a rollback asked for then is refused and the connection
|
|
73
|
+
// stays held, so pool.close() would wait for ever: the first error is kept, and given once 'done' follows.
|
|
74
|
+
let failure;
|
|
72
75
|
request.on('error', (error) => {
|
|
73
76
|
if (!cancelling)
|
|
74
|
-
|
|
77
|
+
failure ??= error;
|
|
75
78
|
});
|
|
76
|
-
request.on('done', () => done());
|
|
79
|
+
request.on('done', () => (failure ? fail(failure) : done()));
|
|
77
80
|
// The semicolon before the query lets it start with WITH, which T-SQL wants after a statement.
|
|
78
81
|
void request.query(`SET ROWCOUNT ${options.limit + 1};\n${text};\nSET ROWCOUNT 0;`);
|
|
79
82
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dbtour-source-mssql",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "SQL Server source for dbtour: tables, views, columns, keys, relations, indexes, descriptions.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -36,6 +36,6 @@
|
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@types/mssql": "^9.1.8",
|
|
39
|
-
"dbtour": "0.
|
|
39
|
+
"dbtour": "0.9.0"
|
|
40
40
|
}
|
|
41
41
|
}
|