@mikro-orm/knex 6.3.12-dev.4 → 6.3.12-dev.6
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/package.json +2 -2
- package/query/QueryBuilder.js +4 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/knex",
|
|
3
|
-
"version": "6.3.12-dev.
|
|
3
|
+
"version": "6.3.12-dev.6",
|
|
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.11"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
|
-
"@mikro-orm/core": "6.3.12-dev.
|
|
69
|
+
"@mikro-orm/core": "6.3.12-dev.6",
|
|
70
70
|
"better-sqlite3": "*",
|
|
71
71
|
"libsql": "*",
|
|
72
72
|
"mariadb": "*"
|
package/query/QueryBuilder.js
CHANGED
|
@@ -624,11 +624,13 @@ class QueryBuilder {
|
|
|
624
624
|
* Executes this QB and returns the raw results, mapped to the property names (unless disabled via last parameter).
|
|
625
625
|
* Use `method` to specify what kind of result you want to get (array/single/meta).
|
|
626
626
|
*/
|
|
627
|
-
async execute(method
|
|
627
|
+
async execute(method, options) {
|
|
628
628
|
options = typeof options === 'boolean' ? { mapResults: options } : (options ?? {});
|
|
629
629
|
options.mergeResults ??= true;
|
|
630
630
|
options.mapResults ??= true;
|
|
631
|
-
|
|
631
|
+
const isRunType = [enums_1.QueryType.INSERT, enums_1.QueryType.UPDATE, enums_1.QueryType.DELETE, enums_1.QueryType.TRUNCATE].includes(this.type ?? enums_1.QueryType.SELECT);
|
|
632
|
+
method ??= isRunType ? 'run' : 'all';
|
|
633
|
+
if (!this.connectionType && method !== 'run' && isRunType) {
|
|
632
634
|
this.connectionType = 'write';
|
|
633
635
|
}
|
|
634
636
|
if (!this.finalized && method === 'get' && this.type === enums_1.QueryType.SELECT) {
|