@mikro-orm/mssql 6.2.9-dev.17 → 6.2.9-dev.18

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.
@@ -10,6 +10,7 @@ export declare class MsSqlSchemaHelper extends SchemaHelper {
10
10
  enableForeignKeysSQL(): string;
11
11
  getDatabaseExistsSQL(name: string): string;
12
12
  getListTablesSQL(): string;
13
+ getNamespaces(connection: AbstractSqlConnection): Promise<string[]>;
13
14
  normalizeDefaultValue(defaultValue: string, length: number, defaultValues?: Dictionary<string[]>, stripQuotes?: boolean): string | number;
14
15
  getAllColumns(connection: AbstractSqlConnection, tables: Table[]): Promise<Dictionary<Column[]>>;
15
16
  getAllIndexes(connection: AbstractSqlConnection, tables: Table[]): Promise<Dictionary<IndexDef[]>>;
@@ -27,6 +27,11 @@ class MsSqlSchemaHelper extends knex_1.SchemaHelper {
27
27
  inner join sys.tables t2 on t2.object_id = t.id
28
28
  left join sys.extended_properties ep on ep.major_id = t.id and ep.name = 'MS_Description' and ep.minor_id = 0`;
29
29
  }
30
+ async getNamespaces(connection) {
31
+ const sql = `select name as schema_name from sys.schemas order by name`;
32
+ const res = await connection.execute(sql);
33
+ return res.map(row => row.schema_name);
34
+ }
30
35
  normalizeDefaultValue(defaultValue, length, defaultValues = {}, stripQuotes = false) {
31
36
  let match = defaultValue?.match(/^\((.*)\)$/);
32
37
  if (match) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/mssql",
3
- "version": "6.2.9-dev.17",
3
+ "version": "6.2.9-dev.18",
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
  "main": "index.js",
6
6
  "module": "index.mjs",
@@ -58,7 +58,7 @@
58
58
  "access": "public"
59
59
  },
60
60
  "dependencies": {
61
- "@mikro-orm/knex": "6.2.9-dev.17",
61
+ "@mikro-orm/knex": "6.2.9-dev.18",
62
62
  "tedious": "18.2.0",
63
63
  "tsqlstring": "1.0.1"
64
64
  },
@@ -66,6 +66,6 @@
66
66
  "@mikro-orm/core": "^6.2.8"
67
67
  },
68
68
  "peerDependencies": {
69
- "@mikro-orm/core": "6.2.9-dev.17"
69
+ "@mikro-orm/core": "6.2.9-dev.18"
70
70
  }
71
71
  }