@mikro-orm/postgresql 6.4.17-dev.60 → 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: {
@@ -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(',')}}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/postgresql",
3
- "version": "6.4.17-dev.60",
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,7 +58,7 @@
58
58
  "access": "public"
59
59
  },
60
60
  "dependencies": {
61
- "@mikro-orm/knex": "6.4.17-dev.60",
61
+ "@mikro-orm/knex": "6.4.17-dev.61",
62
62
  "pg": "8.16.3",
63
63
  "postgres-array": "3.0.4",
64
64
  "postgres-date": "2.1.0",
@@ -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.60"
71
+ "@mikro-orm/core": "6.4.17-dev.61"
72
72
  }
73
73
  }