@mikro-orm/postgresql 6.4.17-dev.8 → 6.4.17-dev.80
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.
- package/PostgreSqlPlatform.d.ts +8 -2
- package/PostgreSqlPlatform.js +13 -1
- package/README.md +1 -2
- package/index.mjs +4 -0
- package/package.json +4 -4
package/PostgreSqlPlatform.d.ts
CHANGED
|
@@ -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
|
|
82
|
+
quoteIdentifier(id: string | {
|
|
83
|
+
toString: () => string;
|
|
84
|
+
}, quote?: string): string;
|
|
79
85
|
escape(value: any): string;
|
|
80
86
|
private pad;
|
|
81
87
|
/** @internal */
|
package/PostgreSqlPlatform.js
CHANGED
|
@@ -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') {
|
|
@@ -259,6 +268,9 @@ class PostgreSqlPlatform extends knex_1.AbstractSqlPlatform {
|
|
|
259
268
|
if (ArrayBuffer.isView(value)) {
|
|
260
269
|
return `E'\\\\x${value.toString('hex')}'`;
|
|
261
270
|
}
|
|
271
|
+
if (Array.isArray(value)) {
|
|
272
|
+
return value.map(v => this.escape(v)).join(', ');
|
|
273
|
+
}
|
|
262
274
|
return super.escape(value);
|
|
263
275
|
}
|
|
264
276
|
pad(number, digits) {
|
package/README.md
CHANGED
|
@@ -11,7 +11,6 @@ TypeScript ORM for Node.js based on Data Mapper, [Unit of Work](https://mikro-or
|
|
|
11
11
|
[](https://discord.gg/w8bjxFHS7X)
|
|
12
12
|
[](https://www.npmjs.com/package/@mikro-orm/core)
|
|
13
13
|
[](https://coveralls.io/r/mikro-orm/mikro-orm?branch=master)
|
|
14
|
-
[](https://codeclimate.com/github/mikro-orm/mikro-orm/maintainability)
|
|
15
14
|
[](https://github.com/mikro-orm/mikro-orm/actions?workflow=tests)
|
|
16
15
|
|
|
17
16
|
## 🤔 Unit of What?
|
|
@@ -141,7 +140,7 @@ There is also auto-generated [CHANGELOG.md](CHANGELOG.md) file based on commit m
|
|
|
141
140
|
- [Composite and Foreign Keys as Primary Key](https://mikro-orm.io/docs/composite-keys)
|
|
142
141
|
- [Filters](https://mikro-orm.io/docs/filters)
|
|
143
142
|
- [Using `QueryBuilder`](https://mikro-orm.io/docs/query-builder)
|
|
144
|
-
- [
|
|
143
|
+
- [Populating relations](https://mikro-orm.io/docs/populating-relations)
|
|
145
144
|
- [Property Validation](https://mikro-orm.io/docs/property-validation)
|
|
146
145
|
- [Lifecycle Hooks](https://mikro-orm.io/docs/events#hooks)
|
|
147
146
|
- [Vanilla JS Support](https://mikro-orm.io/docs/usage-with-js)
|
package/index.mjs
CHANGED
|
@@ -225,12 +225,16 @@ 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;
|
|
230
|
+
export const expandDotPaths = mod.expandDotPaths;
|
|
231
|
+
export const getLoadingStrategy = mod.getLoadingStrategy;
|
|
229
232
|
export const getOnConflictFields = mod.getOnConflictFields;
|
|
230
233
|
export const getOnConflictReturningFields = mod.getOnConflictReturningFields;
|
|
231
234
|
export const helper = mod.helper;
|
|
232
235
|
export const knex = mod.knex;
|
|
233
236
|
export const parseJsonSafe = mod.parseJsonSafe;
|
|
237
|
+
export const quote = mod.quote;
|
|
234
238
|
export const raw = mod.raw;
|
|
235
239
|
export const ref = mod.ref;
|
|
236
240
|
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.
|
|
3
|
+
"version": "6.4.17-dev.80",
|
|
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.
|
|
62
|
-
"pg": "8.16.
|
|
61
|
+
"@mikro-orm/knex": "6.4.17-dev.80",
|
|
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.
|
|
71
|
+
"@mikro-orm/core": "6.4.17-dev.80"
|
|
72
72
|
}
|
|
73
73
|
}
|