@mikro-orm/knex 6.2.8-dev.3 → 6.2.8-dev.4

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 const MonkeyPatchable: {
10
10
  MsSqlDialect: any;
11
11
  PostgresDialect: any;
12
12
  PostgresDialectTableCompiler: any;
13
+ PostgresQueryCompiler: any;
13
14
  Sqlite3Dialect: any;
14
15
  Sqlite3DialectTableCompiler: any;
15
16
  BetterSqlite3Dialect: any;
@@ -27,6 +27,8 @@ const postgres_1 = __importDefault(require("knex/lib/dialects/postgres"));
27
27
  // @ts-ignore
28
28
  const pg_tablecompiler_1 = __importDefault(require("knex/lib/dialects/postgres/schema/pg-tablecompiler"));
29
29
  // @ts-ignore
30
+ const pg_querycompiler_1 = __importDefault(require("knex/lib/dialects/postgres/query/pg-querycompiler"));
31
+ // @ts-ignore
30
32
  const sqlite3_1 = __importDefault(require("knex/lib/dialects/sqlite3"));
31
33
  // @ts-ignore
32
34
  const better_sqlite3_1 = __importDefault(require("knex/lib/dialects/better-sqlite3"));
@@ -50,6 +52,7 @@ exports.MonkeyPatchable = {
50
52
  MsSqlDialect: mssql_1.default,
51
53
  PostgresDialect: postgres_1.default,
52
54
  PostgresDialectTableCompiler: pg_tablecompiler_1.default,
55
+ PostgresQueryCompiler: pg_querycompiler_1.default,
53
56
  Sqlite3Dialect: sqlite3_1.default,
54
57
  Sqlite3DialectTableCompiler: sqlite_tablecompiler_1.default,
55
58
  BetterSqlite3Dialect: better_sqlite3_1.default,
@@ -3,4 +3,5 @@ import { MonkeyPatchable } from '../../MonkeyPatchable';
3
3
  export declare class PostgreSqlKnexDialect extends MonkeyPatchable.PostgresDialect {
4
4
  ormConfig: Configuration;
5
5
  tableCompiler(): any;
6
+ queryCompiler(): any;
6
7
  }
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PostgreSqlKnexDialect = void 0;
4
4
  const PostgreSqlTableCompiler_1 = require("./PostgreSqlTableCompiler");
5
+ const PostgreSqlQueryCompiler_1 = require("./PostgreSqlQueryCompiler");
5
6
  const MonkeyPatchable_1 = require("../../MonkeyPatchable");
6
7
  class PostgreSqlKnexDialect extends MonkeyPatchable_1.MonkeyPatchable.PostgresDialect {
7
8
  ormConfig;
@@ -11,5 +12,9 @@ class PostgreSqlKnexDialect extends MonkeyPatchable_1.MonkeyPatchable.PostgresDi
11
12
  tableCompiler.ormConfig = this.ormConfig;
12
13
  return tableCompiler;
13
14
  }
15
+ queryCompiler() {
16
+ // eslint-disable-next-line prefer-rest-params
17
+ return new PostgreSqlQueryCompiler_1.PostgreSqlQueryCompiler(this, ...arguments);
18
+ }
14
19
  }
15
20
  exports.PostgreSqlKnexDialect = PostgreSqlKnexDialect;
@@ -0,0 +1,4 @@
1
+ import { MonkeyPatchable } from '../../MonkeyPatchable';
2
+ export declare class PostgreSqlQueryCompiler extends MonkeyPatchable.PostgresQueryCompiler {
3
+ _lockingClause(this: any, lockMode: string): string;
4
+ }
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PostgreSqlQueryCompiler = void 0;
4
+ const MonkeyPatchable_1 = require("../../MonkeyPatchable");
5
+ class PostgreSqlQueryCompiler extends MonkeyPatchable_1.MonkeyPatchable.PostgresQueryCompiler {
6
+ _lockingClause(lockMode) {
7
+ const tables = this.single.lockTables || [];
8
+ return lockMode + (tables.length
9
+ ? ' of ' + tables.filter(Boolean).map((table) => this.formatter.wrap(table)).join(', ')
10
+ : '');
11
+ }
12
+ }
13
+ exports.PostgreSqlQueryCompiler = PostgreSqlQueryCompiler;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/knex",
3
- "version": "6.2.8-dev.3",
3
+ "version": "6.2.8-dev.4",
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",
@@ -66,6 +66,6 @@
66
66
  "@mikro-orm/core": "^6.2.7"
67
67
  },
68
68
  "peerDependencies": {
69
- "@mikro-orm/core": "6.2.8-dev.3"
69
+ "@mikro-orm/core": "6.2.8-dev.4"
70
70
  }
71
71
  }