@mikro-orm/postgresql 6.4.17-dev.10 → 6.4.17-dev.100
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 +16 -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
|
@@ -67,6 +67,7 @@ export const DriverException = mod.DriverException;
|
|
|
67
67
|
export const EagerProps = mod.EagerProps;
|
|
68
68
|
export const Embeddable = mod.Embeddable;
|
|
69
69
|
export const Embedded = mod.Embedded;
|
|
70
|
+
export const EmbeddedOptionsBuilder = mod.EmbeddedOptionsBuilder;
|
|
70
71
|
export const EnsureRequestContext = mod.EnsureRequestContext;
|
|
71
72
|
export const Entity = mod.Entity;
|
|
72
73
|
export const EntityAssigner = mod.EntityAssigner;
|
|
@@ -87,6 +88,7 @@ export const EntityTransformer = mod.EntityTransformer;
|
|
|
87
88
|
export const EntityValidator = mod.EntityValidator;
|
|
88
89
|
export const Enum = mod.Enum;
|
|
89
90
|
export const EnumArrayType = mod.EnumArrayType;
|
|
91
|
+
export const EnumOptionsBuilder = mod.EnumOptionsBuilder;
|
|
90
92
|
export const EnumType = mod.EnumType;
|
|
91
93
|
export const EventManager = mod.EventManager;
|
|
92
94
|
export const EventType = mod.EventType;
|
|
@@ -119,7 +121,9 @@ export const LoadStrategy = mod.LoadStrategy;
|
|
|
119
121
|
export const LockMode = mod.LockMode;
|
|
120
122
|
export const LockWaitTimeoutException = mod.LockWaitTimeoutException;
|
|
121
123
|
export const ManyToMany = mod.ManyToMany;
|
|
124
|
+
export const ManyToManyOptionsBuilder = mod.ManyToManyOptionsBuilder;
|
|
122
125
|
export const ManyToOne = mod.ManyToOne;
|
|
126
|
+
export const ManyToOneOptionsBuilder = mod.ManyToOneOptionsBuilder;
|
|
123
127
|
export const MariaDbKnexDialect = mod.MariaDbKnexDialect;
|
|
124
128
|
export const MediumIntType = mod.MediumIntType;
|
|
125
129
|
export const MemoryCacheAdapter = mod.MemoryCacheAdapter;
|
|
@@ -149,7 +153,10 @@ export const ObjectHydrator = mod.ObjectHydrator;
|
|
|
149
153
|
export const OnInit = mod.OnInit;
|
|
150
154
|
export const OnLoad = mod.OnLoad;
|
|
151
155
|
export const OneToMany = mod.OneToMany;
|
|
156
|
+
export const OneToManyOptionsBuilder = mod.OneToManyOptionsBuilder;
|
|
157
|
+
export const OneToManyOptionsBuilderOnlyMappedBy = mod.OneToManyOptionsBuilderOnlyMappedBy;
|
|
152
158
|
export const OneToOne = mod.OneToOne;
|
|
159
|
+
export const OneToOneOptionsBuilder = mod.OneToOneOptionsBuilder;
|
|
153
160
|
export const OptimisticLockError = mod.OptimisticLockError;
|
|
154
161
|
export const OptionalProps = mod.OptionalProps;
|
|
155
162
|
export const PlainObject = mod.PlainObject;
|
|
@@ -165,6 +172,7 @@ export const PostgreSqlSchemaHelper = mod.PostgreSqlSchemaHelper;
|
|
|
165
172
|
export const PrimaryKey = mod.PrimaryKey;
|
|
166
173
|
export const PrimaryKeyProp = mod.PrimaryKeyProp;
|
|
167
174
|
export const Property = mod.Property;
|
|
175
|
+
export const PropertyOptionsBuilder = mod.PropertyOptionsBuilder;
|
|
168
176
|
export const QueryBuilder = mod.QueryBuilder;
|
|
169
177
|
export const QueryBuilderHelper = mod.QueryBuilderHelper;
|
|
170
178
|
export const QueryFlag = mod.QueryFlag;
|
|
@@ -178,6 +186,7 @@ export const ReadOnlyException = mod.ReadOnlyException;
|
|
|
178
186
|
export const Ref = mod.Ref;
|
|
179
187
|
export const Reference = mod.Reference;
|
|
180
188
|
export const ReferenceKind = mod.ReferenceKind;
|
|
189
|
+
export const ReferenceOptionsBuilder = mod.ReferenceOptionsBuilder;
|
|
181
190
|
export const ReflectMetadataProvider = mod.ReflectMetadataProvider;
|
|
182
191
|
export const RequestContext = mod.RequestContext;
|
|
183
192
|
export const SCALAR_TYPES = mod.SCALAR_TYPES;
|
|
@@ -205,6 +214,9 @@ export const TimeType = mod.TimeType;
|
|
|
205
214
|
export const TinyIntType = mod.TinyIntType;
|
|
206
215
|
export const TransactionContext = mod.TransactionContext;
|
|
207
216
|
export const TransactionEventBroadcaster = mod.TransactionEventBroadcaster;
|
|
217
|
+
export const TransactionManager = mod.TransactionManager;
|
|
218
|
+
export const TransactionPropagation = mod.TransactionPropagation;
|
|
219
|
+
export const TransactionStateError = mod.TransactionStateError;
|
|
208
220
|
export const Transactional = mod.Transactional;
|
|
209
221
|
export const Type = mod.Type;
|
|
210
222
|
export const Uint8ArrayType = mod.Uint8ArrayType;
|
|
@@ -225,12 +237,16 @@ export const compareBuffers = mod.compareBuffers;
|
|
|
225
237
|
export const compareObjects = mod.compareObjects;
|
|
226
238
|
export const createSqlFunction = mod.createSqlFunction;
|
|
227
239
|
export const defineConfig = mod.defineConfig;
|
|
240
|
+
export const defineEntity = mod.defineEntity;
|
|
228
241
|
export const equals = mod.equals;
|
|
242
|
+
export const expandDotPaths = mod.expandDotPaths;
|
|
243
|
+
export const getLoadingStrategy = mod.getLoadingStrategy;
|
|
229
244
|
export const getOnConflictFields = mod.getOnConflictFields;
|
|
230
245
|
export const getOnConflictReturningFields = mod.getOnConflictReturningFields;
|
|
231
246
|
export const helper = mod.helper;
|
|
232
247
|
export const knex = mod.knex;
|
|
233
248
|
export const parseJsonSafe = mod.parseJsonSafe;
|
|
249
|
+
export const quote = mod.quote;
|
|
234
250
|
export const raw = mod.raw;
|
|
235
251
|
export const ref = mod.ref;
|
|
236
252
|
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.100",
|
|
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.100",
|
|
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.100"
|
|
72
72
|
}
|
|
73
73
|
}
|