@mikro-orm/mssql 7.0.13-dev.5 → 7.0.13-dev.6

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.
@@ -11,8 +11,11 @@ export class MsSqlSchemaHelper extends SchemaHelper {
11
11
  return 'master';
12
12
  }
13
13
  getDropDatabaseSQL(name) {
14
+ // `set offline` rejects all connections including the issuing session, so there is no
15
+ // single-user race window where a torn-down pool connection can reconnect between the
16
+ // mode switch and the drop (SQL Server error 3702 "currently in use").
14
17
  const quoted = this.quote(name);
15
- return `if db_id(${this.platform.quoteValue(name)}) is not null begin alter database ${quoted} set single_user with rollback immediate; drop database ${quoted}; end`;
18
+ return `if db_id(${this.platform.quoteValue(name)}) is not null begin alter database ${quoted} set offline with rollback immediate; drop database ${quoted}; end`;
16
19
  }
17
20
  disableForeignKeysSQL() {
18
21
  return `exec sp_MSforeachtable 'alter table ? nocheck constraint all';`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/mssql",
3
- "version": "7.0.13-dev.5",
3
+ "version": "7.0.13-dev.6",
4
4
  "description": "TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, PostgreSQL and SQLite databases as well as usage with vanilla JavaScript.",
5
5
  "keywords": [
6
6
  "data-mapper",
@@ -47,7 +47,7 @@
47
47
  "copy": "node ../../scripts/copy.mjs"
48
48
  },
49
49
  "dependencies": {
50
- "@mikro-orm/sql": "7.0.13-dev.5",
50
+ "@mikro-orm/sql": "7.0.13-dev.6",
51
51
  "kysely": "0.28.16",
52
52
  "tarn": "3.0.2",
53
53
  "tedious": "19.2.1",
@@ -57,7 +57,7 @@
57
57
  "@mikro-orm/core": "^7.0.12"
58
58
  },
59
59
  "peerDependencies": {
60
- "@mikro-orm/core": "7.0.13-dev.5"
60
+ "@mikro-orm/core": "7.0.13-dev.6"
61
61
  },
62
62
  "engines": {
63
63
  "node": ">= 22.17.0"