@mikro-orm/oracledb 7.1.0-dev.24 → 7.1.0-dev.26

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.
@@ -5,6 +5,10 @@ export declare class OracleSchemaHelper extends SchemaHelper {
5
5
  private static readonly AUTO_NOT_NULL_RE;
6
6
  private static readonly PARTIAL_INDEX_RE;
7
7
  getDatabaseExistsSQL(name: string): string;
8
+ getSetSchemaSQL(schema: string): string;
9
+ getResetSchemaSQL(defaultSchema: string): string;
10
+ supportsMigrationSchema(): boolean;
11
+ tableExists(connection: AbstractSqlConnection, tableName: string, schemaName: string | undefined, ctx?: Transaction): Promise<boolean>;
8
12
  getAllTables(connection: AbstractSqlConnection, schemas?: string[], ctx?: Transaction): Promise<Table[]>;
9
13
  getListTablesSQL(schemaName?: string): string;
10
14
  getListViewsSQL(): string;
@@ -16,6 +16,20 @@ export class OracleSchemaHelper extends SchemaHelper {
16
16
  getDatabaseExistsSQL(name) {
17
17
  return `select 1 from all_users where username = ${this.platform.quoteValue(name)}`;
18
18
  }
19
+ getSetSchemaSQL(schema) {
20
+ return `alter session set current_schema = ${this.quote(schema)}`;
21
+ }
22
+ getResetSchemaSQL(defaultSchema) {
23
+ return `alter session set current_schema = ${this.quote(defaultSchema)}`;
24
+ }
25
+ supportsMigrationSchema() {
26
+ return true;
27
+ }
28
+ async tableExists(connection, tableName, schemaName, ctx) {
29
+ const schema = schemaName ?? this.platform.getDefaultSchemaName();
30
+ const rows = await connection.execute(`select 1 from all_tables where owner = ${this.platform.quoteValue(schema)} and table_name = ${this.platform.quoteValue(tableName)}`, [], 'all', ctx);
31
+ return rows.length > 0;
32
+ }
19
33
  async getAllTables(connection, schemas, ctx) {
20
34
  if (!schemas || schemas.length === 0) {
21
35
  return connection.execute(this.getListTablesSQL(), [], 'all', ctx);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/oracledb",
3
- "version": "7.1.0-dev.24",
3
+ "version": "7.1.0-dev.26",
4
4
  "description": "TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, MariaDB, PostgreSQL, SQLite, MSSQL and Oracle databases.",
5
5
  "keywords": [
6
6
  "data-mapper",
@@ -42,7 +42,7 @@
42
42
  "copy": "node ../../scripts/copy.mjs"
43
43
  },
44
44
  "dependencies": {
45
- "@mikro-orm/sql": "7.1.0-dev.24",
45
+ "@mikro-orm/sql": "7.1.0-dev.26",
46
46
  "kysely": "0.28.16",
47
47
  "oracledb": "6.10.0"
48
48
  },
@@ -50,7 +50,7 @@
50
50
  "@mikro-orm/core": "^7.0.13"
51
51
  },
52
52
  "peerDependencies": {
53
- "@mikro-orm/core": "7.1.0-dev.24"
53
+ "@mikro-orm/core": "7.1.0-dev.26"
54
54
  },
55
55
  "engines": {
56
56
  "node": ">= 22.17.0"