@mikro-orm/sql 7.2.11-dev.12 → 7.2.11-dev.14

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.
@@ -28,6 +28,7 @@ interface OracleResultSet<R> {
28
28
  declare class OracleQueryCompiler extends DefaultQueryCompiler {
29
29
  protected getLeftIdentifierWrapper(): string;
30
30
  protected getRightIdentifierWrapper(): string;
31
+ protected getCurrentParameterPlaceholder(): string;
31
32
  protected visitAlias(node: AliasNode): void;
32
33
  }
33
34
  declare class OracleAdapter extends DialectAdapterBase {
@@ -42,10 +43,6 @@ declare class OracleConnection implements DatabaseConnection {
42
43
  readonly id: number;
43
44
  constructor(connection: OraclePoolConnection, executeOptions?: Record<string, unknown>);
44
45
  executeQuery<R>(compiledQuery: CompiledQuery): Promise<QueryResult<R>>;
45
- formatQuery(query: CompiledQuery): {
46
- sql: string;
47
- bindParams: unknown[];
48
- };
49
46
  streamQuery<R>(compiledQuery: CompiledQuery, chunkSize?: number): AsyncIterableIterator<QueryResult<R>>;
50
47
  get connection(): OraclePoolConnection;
51
48
  }
@@ -14,6 +14,9 @@ class OracleQueryCompiler extends DefaultQueryCompiler {
14
14
  getRightIdentifierWrapper() {
15
15
  return '';
16
16
  }
17
+ getCurrentParameterPlaceholder() {
18
+ return ':' + (this.numParameters - 1);
19
+ }
17
20
  visitAlias(node) {
18
21
  this.visitNode(node.node);
19
22
  this.append(' ');
@@ -47,8 +50,7 @@ class OracleConnection {
47
50
  this.#connection = connection;
48
51
  }
49
52
  async executeQuery(compiledQuery) {
50
- const { sql, bindParams } = this.formatQuery(compiledQuery);
51
- const result = await this.#connection.execute(sql, bindParams, {
53
+ const result = await this.#connection.execute(compiledQuery.sql, compiledQuery.parameters, {
52
54
  autoCommit: compiledQuery.autoCommit,
53
55
  outFormat: OUT_FORMAT_OBJECT,
54
56
  ...this.#executeOptions,
@@ -60,15 +62,8 @@ class OracleConnection {
60
62
  outBinds: result.outBinds,
61
63
  };
62
64
  }
63
- formatQuery(query) {
64
- return {
65
- sql: query.sql.replace(/\$(\d+)/g, (_match, p1) => `:${parseInt(p1, 10) - 1}`), // Format bind params in Oracle syntax :0, :1, etc.
66
- bindParams: query.parameters,
67
- };
68
- }
69
65
  async *streamQuery(compiledQuery, chunkSize) {
70
- const { sql, bindParams } = this.formatQuery(compiledQuery);
71
- const result = await this.#connection.execute(sql, bindParams, {
66
+ const result = await this.#connection.execute(compiledQuery.sql, compiledQuery.parameters, {
72
67
  resultSet: true,
73
68
  autoCommit: compiledQuery.autoCommit,
74
69
  outFormat: OUT_FORMAT_OBJECT,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/sql",
3
- "version": "7.2.11-dev.12",
3
+ "version": "7.2.11-dev.14",
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",
@@ -53,7 +53,7 @@
53
53
  "@mikro-orm/core": "^7.2.10"
54
54
  },
55
55
  "peerDependencies": {
56
- "@mikro-orm/core": "7.2.11-dev.12"
56
+ "@mikro-orm/core": "7.2.11-dev.14"
57
57
  },
58
58
  "engines": {
59
59
  "node": ">= 22.17.0"