@mikro-orm/postgresql 6.3.11-dev.2 → 6.3.11-dev.21

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.
@@ -76,7 +76,7 @@ export declare class PostgreSqlPlatform extends AbstractSqlPlatform {
76
76
  getSearchJsonPropertyKey(path: string[], type: string | undefined | Type, aliased: boolean, value?: unknown): string;
77
77
  getJsonIndexDefinition(index: IndexDef): string[];
78
78
  quoteIdentifier(id: string, quote?: string): string;
79
- quoteValue(value: any): string;
79
+ escape(value: any): string;
80
80
  private pad;
81
81
  /** @internal */
82
82
  formatDate(date: Date): string;
@@ -86,7 +86,7 @@ export declare class PostgreSqlPlatform extends AbstractSqlPlatform {
86
86
  getDefaultSchemaName(): string | undefined;
87
87
  /**
88
88
  * Returns the default name of index for the given columns
89
- * cannot go past 64 character length for identifiers in MySQL
89
+ * cannot go past 63 character length for identifiers in MySQL
90
90
  */
91
91
  getIndexName(tableName: string, columns: string[], type: 'index' | 'unique' | 'foreign' | 'primary' | 'sequence'): string;
92
92
  getDefaultPrimaryName(tableName: string, columns: string[]): string;
@@ -249,11 +249,7 @@ class PostgreSqlPlatform extends knex_1.AbstractSqlPlatform {
249
249
  quoteIdentifier(id, quote = '"') {
250
250
  return `${quote}${id.replace('.', `${quote}.${quote}`)}${quote}`;
251
251
  }
252
- quoteValue(value) {
253
- /* istanbul ignore if */
254
- if (core_1.Utils.isPlainObject(value) || value?.[core_1.JsonProperty]) {
255
- value = JSON.stringify(value);
256
- }
252
+ escape(value) {
257
253
  if (typeof value === 'string') {
258
254
  return pg_1.Client.prototype.escapeLiteral(value);
259
255
  }
@@ -263,7 +259,7 @@ class PostgreSqlPlatform extends knex_1.AbstractSqlPlatform {
263
259
  if (ArrayBuffer.isView(value)) {
264
260
  return `E'\\\\x${value.toString('hex')}'`;
265
261
  }
266
- return super.quoteValue(value);
262
+ return super.escape(value);
267
263
  }
268
264
  pad(number, digits) {
269
265
  return String(number).padStart(digits, '0');
@@ -335,19 +331,19 @@ class PostgreSqlPlatform extends knex_1.AbstractSqlPlatform {
335
331
  }
336
332
  /**
337
333
  * Returns the default name of index for the given columns
338
- * cannot go past 64 character length for identifiers in MySQL
334
+ * cannot go past 63 character length for identifiers in MySQL
339
335
  */
340
336
  getIndexName(tableName, columns, type) {
341
337
  const indexName = super.getIndexName(tableName, columns, type);
342
- if (indexName.length > 64) {
343
- return `${indexName.substring(0, 56 - type.length)}_${core_1.Utils.hash(indexName, 5)}_${type}`;
338
+ if (indexName.length > 63) {
339
+ return `${indexName.substring(0, 55 - type.length)}_${core_1.Utils.hash(indexName, 5)}_${type}`;
344
340
  }
345
341
  return indexName;
346
342
  }
347
343
  getDefaultPrimaryName(tableName, columns) {
348
344
  const indexName = `${tableName}_pkey`;
349
- if (indexName.length > 64) {
350
- return `${indexName.substring(0, 56 - 'primary'.length)}_${core_1.Utils.hash(indexName, 5)}_primary`;
345
+ if (indexName.length > 63) {
346
+ return `${indexName.substring(0, 55 - 'primary'.length)}_${core_1.Utils.hash(indexName, 5)}_primary`;
351
347
  }
352
348
  return indexName;
353
349
  }
package/README.md CHANGED
@@ -164,6 +164,7 @@ You can find example integrations for some popular frameworks in the [`mikro-orm
164
164
  - [Accounts.js REST and GraphQL authentication + SQLite](https://github.com/darkbasic/mikro-orm-accounts-example)
165
165
  - [Nest + Shopify + PostgreSQL + GraphQL](https://github.com/Cloudshelf/Shopify_CSConnector)
166
166
  - [Elysia.js + libSQL + Bun](https://github.com/mikro-orm/elysia-bun-example-app)
167
+ - [Electron.js + PostgreSQL](https://github.com/adnanlah/electron-mikro-orm-example-app)
167
168
 
168
169
  ### JavaScript Examples
169
170
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/postgresql",
3
- "version": "6.3.11-dev.2",
3
+ "version": "6.3.11-dev.21",
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.3.11-dev.2",
62
- "pg": "8.12.0",
61
+ "@mikro-orm/knex": "6.3.11-dev.21",
62
+ "pg": "8.13.0",
63
63
  "postgres-array": "3.0.2",
64
64
  "postgres-date": "2.1.0",
65
65
  "postgres-interval": "4.0.2"
@@ -68,6 +68,6 @@
68
68
  "@mikro-orm/core": "^6.3.10"
69
69
  },
70
70
  "peerDependencies": {
71
- "@mikro-orm/core": "6.3.11-dev.2"
71
+ "@mikro-orm/core": "6.3.11-dev.21"
72
72
  }
73
73
  }