@mikro-orm/knex 6.3.5-dev.14 → 6.3.5-dev.16
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/README.md +1 -0
- package/package.json +2 -2
- package/schema/DatabaseTable.js +7 -4
package/README.md
CHANGED
|
@@ -163,6 +163,7 @@ You can find example integrations for some popular frameworks in the [`mikro-orm
|
|
|
163
163
|
- [NextJS + MySQL](https://github.com/jonahallibone/mikro-orm-nextjs)
|
|
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
|
+
- [Elysia.js + libSQL + Bun](https://github.com/mikro-orm/elysia-bun-example-app)
|
|
166
167
|
|
|
167
168
|
### JavaScript Examples
|
|
168
169
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/knex",
|
|
3
|
-
"version": "6.3.5-dev.
|
|
3
|
+
"version": "6.3.5-dev.16",
|
|
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",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"@mikro-orm/core": "^6.3.4"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
|
-
"@mikro-orm/core": "6.3.5-dev.
|
|
69
|
+
"@mikro-orm/core": "6.3.5-dev.16",
|
|
70
70
|
"better-sqlite3": "*",
|
|
71
71
|
"libsql": "*",
|
|
72
72
|
"mariadb": "*"
|
package/schema/DatabaseTable.js
CHANGED
|
@@ -591,6 +591,11 @@ class DatabaseTable {
|
|
|
591
591
|
const unique = compositeFkUniques[prop] || this.indexes.find(idx => idx.columnNames[0] === column.name && !idx.composite && idx.unique && !idx.primary);
|
|
592
592
|
const kind = this.getReferenceKind(fk, unique);
|
|
593
593
|
const runtimeType = this.getPropertyTypeForColumn(namingStrategy, column, fk);
|
|
594
|
+
const type = fk ? runtimeType : (core_1.Utils.keys(core_1.t).find(k => {
|
|
595
|
+
const typeInCoreMap = this.platform.getMappedType(k);
|
|
596
|
+
return (typeInCoreMap !== core_1.Type.getType(core_1.UnknownType) || k === 'unknown') && typeInCoreMap === column.mappedType;
|
|
597
|
+
}) ?? runtimeType);
|
|
598
|
+
const ignoreSchemaChanges = (type === 'unknown' && column.length) ? (column.extra ? ['type', 'extra'] : ['type']) : undefined;
|
|
594
599
|
const defaultRaw = this.getPropertyDefaultValue(schemaHelper, column, runtimeType, true);
|
|
595
600
|
const defaultParsed = this.getPropertyDefaultValue(schemaHelper, column, runtimeType);
|
|
596
601
|
const defaultTs = defaultRaw !== defaultParsed ? defaultParsed : undefined;
|
|
@@ -605,12 +610,10 @@ class DatabaseTable {
|
|
|
605
610
|
}
|
|
606
611
|
return {
|
|
607
612
|
name: prop,
|
|
608
|
-
type
|
|
609
|
-
const typeInCoreMap = this.platform.getMappedType(k);
|
|
610
|
-
return (typeInCoreMap !== core_1.Type.getType(core_1.UnknownType) || k === 'unknown') && typeInCoreMap === column.mappedType;
|
|
611
|
-
}) ?? runtimeType),
|
|
613
|
+
type,
|
|
612
614
|
runtimeType,
|
|
613
615
|
kind,
|
|
616
|
+
ignoreSchemaChanges,
|
|
614
617
|
generated: column.generated,
|
|
615
618
|
optional: defaultRaw !== 'null' || defaultTs != null || typeof column.generated !== 'undefined',
|
|
616
619
|
columnType: column.type,
|