@mikro-orm/postgresql 6.4.17-dev.6 → 6.4.17-dev.61

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.
@@ -1,5 +1,5 @@
1
1
  import { type IPostgresInterval } from 'postgres-interval';
2
- import { type EntityProperty, Type, type SimpleColumnMeta, type Configuration } from '@mikro-orm/core';
2
+ import { type EntityProperty, Type, type SimpleColumnMeta, type Configuration, type IsolationLevel } from '@mikro-orm/core';
3
3
  import { AbstractSqlPlatform, type IndexDef } from '@mikro-orm/knex';
4
4
  import { PostgreSqlSchemaHelper } from './PostgreSqlSchemaHelper';
5
5
  import { PostgreSqlExceptionConverter } from './PostgreSqlExceptionConverter';
@@ -60,6 +60,10 @@ export declare class PostgreSqlPlatform extends AbstractSqlPlatform {
60
60
  nativeEnumName?: string;
61
61
  }): string;
62
62
  supportsMultipleStatements(): boolean;
63
+ getBeginTransactionSQL(options?: {
64
+ isolationLevel?: IsolationLevel;
65
+ readOnly?: boolean;
66
+ }): string[];
63
67
  marshallArray(values: string[]): string;
64
68
  unmarshallArray(value: string): string[];
65
69
  getVarcharTypeDeclarationSQL(column: {
@@ -75,7 +79,9 @@ export declare class PostgreSqlPlatform extends AbstractSqlPlatform {
75
79
  getJsonDeclarationSQL(): string;
76
80
  getSearchJsonPropertyKey(path: string[], type: string | undefined | Type, aliased: boolean, value?: unknown): string;
77
81
  getJsonIndexDefinition(index: IndexDef): string[];
78
- quoteIdentifier(id: string, quote?: string): string;
82
+ quoteIdentifier(id: string | {
83
+ toString: () => string;
84
+ }, quote?: string): string;
79
85
  escape(value: any): string;
80
86
  private pad;
81
87
  /** @internal */
@@ -171,6 +171,15 @@ class PostgreSqlPlatform extends knex_1.AbstractSqlPlatform {
171
171
  supportsMultipleStatements() {
172
172
  return true;
173
173
  }
174
+ getBeginTransactionSQL(options) {
175
+ if (options?.isolationLevel || options?.readOnly) {
176
+ let sql = 'start transaction';
177
+ sql += options.isolationLevel ? ` isolation level ${options.isolationLevel}` : '';
178
+ sql += options.readOnly ? ` read only` : '';
179
+ return [sql];
180
+ }
181
+ return ['begin'];
182
+ }
174
183
  marshallArray(values) {
175
184
  const quote = (v) => v === '' || v.match(/["{},\\]/) ? JSON.stringify(v) : v;
176
185
  return `{${values.map(v => quote('' + v)).join(',')}}`;
@@ -247,7 +256,7 @@ class PostgreSqlPlatform extends knex_1.AbstractSqlPlatform {
247
256
  });
248
257
  }
249
258
  quoteIdentifier(id, quote = '"') {
250
- return `${quote}${id.replace('.', `${quote}.${quote}`)}${quote}`;
259
+ return `${quote}${id.toString().replace('.', `${quote}.${quote}`)}${quote}`;
251
260
  }
252
261
  escape(value) {
253
262
  if (typeof value === 'string') {
package/README.md CHANGED
@@ -141,7 +141,7 @@ There is also auto-generated [CHANGELOG.md](CHANGELOG.md) file based on commit m
141
141
  - [Composite and Foreign Keys as Primary Key](https://mikro-orm.io/docs/composite-keys)
142
142
  - [Filters](https://mikro-orm.io/docs/filters)
143
143
  - [Using `QueryBuilder`](https://mikro-orm.io/docs/query-builder)
144
- - [Preloading Deeply Nested Structures via populate](https://mikro-orm.io/docs/nested-populate)
144
+ - [Populating relations](https://mikro-orm.io/docs/populating-relations)
145
145
  - [Property Validation](https://mikro-orm.io/docs/property-validation)
146
146
  - [Lifecycle Hooks](https://mikro-orm.io/docs/events#hooks)
147
147
  - [Vanilla JS Support](https://mikro-orm.io/docs/usage-with-js)
package/index.mjs CHANGED
@@ -225,12 +225,14 @@ export const compareBuffers = mod.compareBuffers;
225
225
  export const compareObjects = mod.compareObjects;
226
226
  export const createSqlFunction = mod.createSqlFunction;
227
227
  export const defineConfig = mod.defineConfig;
228
+ export const defineEntity = mod.defineEntity;
228
229
  export const equals = mod.equals;
229
230
  export const getOnConflictFields = mod.getOnConflictFields;
230
231
  export const getOnConflictReturningFields = mod.getOnConflictReturningFields;
231
232
  export const helper = mod.helper;
232
233
  export const knex = mod.knex;
233
234
  export const parseJsonSafe = mod.parseJsonSafe;
235
+ export const quote = mod.quote;
234
236
  export const raw = mod.raw;
235
237
  export const ref = mod.ref;
236
238
  export const rel = mod.rel;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/postgresql",
3
- "version": "6.4.17-dev.6",
3
+ "version": "6.4.17-dev.61",
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,8 +58,8 @@
58
58
  "access": "public"
59
59
  },
60
60
  "dependencies": {
61
- "@mikro-orm/knex": "6.4.17-dev.6",
62
- "pg": "8.16.0",
61
+ "@mikro-orm/knex": "6.4.17-dev.61",
62
+ "pg": "8.16.3",
63
63
  "postgres-array": "3.0.4",
64
64
  "postgres-date": "2.1.0",
65
65
  "postgres-interval": "4.0.2"
@@ -68,6 +68,6 @@
68
68
  "@mikro-orm/core": "^6.4.16"
69
69
  },
70
70
  "peerDependencies": {
71
- "@mikro-orm/core": "6.4.17-dev.6"
71
+ "@mikro-orm/core": "6.4.17-dev.61"
72
72
  }
73
73
  }