@mikro-orm/postgresql 7.0.0-dev.21 → 7.0.0-dev.23
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 +3 -1
- package/PostgreSqlPlatform.js +4 -1
- package/PostgreSqlSchemaHelper.js +3 -2
- package/README.md +1 -2
- package/package.json +6 -6
package/PostgreSqlPlatform.d.ts
CHANGED
|
@@ -81,7 +81,9 @@ export declare class PostgreSqlPlatform extends AbstractSqlPlatform {
|
|
|
81
81
|
getJsonDeclarationSQL(): string;
|
|
82
82
|
getSearchJsonPropertyKey(path: string[], type: string | undefined | Type, aliased: boolean, value?: unknown): string;
|
|
83
83
|
getJsonIndexDefinition(index: IndexDef): string[];
|
|
84
|
-
quoteIdentifier(id: string
|
|
84
|
+
quoteIdentifier(id: string | {
|
|
85
|
+
toString: () => string;
|
|
86
|
+
}, quote?: string): string;
|
|
85
87
|
escape(value: any): string;
|
|
86
88
|
private pad;
|
|
87
89
|
/** @internal */
|
package/PostgreSqlPlatform.js
CHANGED
|
@@ -258,7 +258,7 @@ export class PostgreSqlPlatform extends AbstractSqlPlatform {
|
|
|
258
258
|
if (RawQueryFragment.isKnownFragment(id)) {
|
|
259
259
|
return super.quoteIdentifier(id);
|
|
260
260
|
}
|
|
261
|
-
return `${quote}${id.replace('.', `${quote}.${quote}`)}${quote}`;
|
|
261
|
+
return `${quote}${id.toString().replace('.', `${quote}.${quote}`)}${quote}`;
|
|
262
262
|
}
|
|
263
263
|
escape(value) {
|
|
264
264
|
if (typeof value === 'string') {
|
|
@@ -270,6 +270,9 @@ export class PostgreSqlPlatform extends AbstractSqlPlatform {
|
|
|
270
270
|
if (ArrayBuffer.isView(value)) {
|
|
271
271
|
return `E'\\\\x${value.toString('hex')}'`;
|
|
272
272
|
}
|
|
273
|
+
if (Array.isArray(value)) {
|
|
274
|
+
return value.map(v => this.escape(v)).join(', ');
|
|
275
|
+
}
|
|
273
276
|
return super.escape(value);
|
|
274
277
|
}
|
|
275
278
|
pad(number, digits) {
|
|
@@ -321,7 +321,8 @@ export class PostgreSqlSchemaHelper extends SchemaHelper {
|
|
|
321
321
|
}, {});
|
|
322
322
|
}
|
|
323
323
|
createTableColumn(column, table) {
|
|
324
|
-
const
|
|
324
|
+
const pk = table.getPrimaryKey();
|
|
325
|
+
const compositePK = pk?.composite;
|
|
325
326
|
const primaryKey = !this.hasNonDefaultPrimaryKeyName(table);
|
|
326
327
|
const col = [this.quote(column.name)];
|
|
327
328
|
if (column.autoincrement && !column.generated && !compositePK) {
|
|
@@ -351,7 +352,7 @@ export class PostgreSqlSchemaHelper extends SchemaHelper {
|
|
|
351
352
|
Utils.runIfNotEmpty(() => col.push('null'), column.nullable);
|
|
352
353
|
Utils.runIfNotEmpty(() => col.push('not null'), !column.nullable);
|
|
353
354
|
}
|
|
354
|
-
if (column.autoincrement && !
|
|
355
|
+
if (column.autoincrement && !compositePK) {
|
|
355
356
|
Utils.runIfNotEmpty(() => col.push('primary key'), primaryKey && column.primary);
|
|
356
357
|
}
|
|
357
358
|
const useDefault = column.default != null && column.default !== 'null' && !column.autoincrement;
|
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/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/postgresql",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "7.0.0-dev.
|
|
4
|
+
"version": "7.0.0-dev.23",
|
|
5
5
|
"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.",
|
|
6
6
|
"exports": {
|
|
7
7
|
"./package.json": "./package.json",
|
|
@@ -50,18 +50,18 @@
|
|
|
50
50
|
"access": "public"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@mikro-orm/knex": "7.0.0-dev.
|
|
54
|
-
"pg": "8.
|
|
53
|
+
"@mikro-orm/knex": "7.0.0-dev.23",
|
|
54
|
+
"pg": "8.16.3",
|
|
55
55
|
"postgres-array": "3.0.4",
|
|
56
56
|
"postgres-date": "2.1.0",
|
|
57
57
|
"postgres-interval": "4.0.2"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"@mikro-orm/core": "^6.
|
|
61
|
-
"kysely": "0.28.
|
|
60
|
+
"@mikro-orm/core": "^6.5.1",
|
|
61
|
+
"kysely": "0.28.5"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
|
-
"@mikro-orm/core": "7.0.0-dev.
|
|
64
|
+
"@mikro-orm/core": "7.0.0-dev.23",
|
|
65
65
|
"kysely": "*"
|
|
66
66
|
}
|
|
67
67
|
}
|