@mikro-orm/oracledb 7.2.2-dev.6 → 7.2.2-dev.7
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/OracleDriver.d.ts +2 -1
- package/OracleDriver.js +11 -13
- package/package.json +3 -3
package/OracleDriver.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type AnyEntity, type Configuration, type ConnectionType, type Constructor, type EntityDictionary, type EntityName, type FilterQuery, type LoggingOptions, type NativeInsertUpdateManyOptions, type QueryResult, type Transaction, type UpsertManyOptions } from '@mikro-orm/core';
|
|
1
|
+
import { type AnyEntity, type Configuration, type ConnectionType, type Constructor, type EntityDictionary, type EntityName, type EntityProperty, type FilterQuery, type LoggingOptions, type NativeInsertUpdateManyOptions, type QueryResult, type Transaction, type UpsertManyOptions } from '@mikro-orm/core';
|
|
2
2
|
import { AbstractSqlDriver, type SqlEntityManager } from '@mikro-orm/sql';
|
|
3
3
|
import { OracleConnection } from './OracleConnection.js';
|
|
4
4
|
import { OracleMikroORM } from './OracleMikroORM.js';
|
|
@@ -9,6 +9,7 @@ export declare class OracleDriver extends AbstractSqlDriver<OracleConnection, Or
|
|
|
9
9
|
constructor(config: Configuration);
|
|
10
10
|
createQueryBuilder<T extends AnyEntity<T>>(entityName: EntityName<T>, ctx?: Transaction, preferredConnectionType?: ConnectionType, convertCustomTypes?: boolean, loggerContext?: LoggingOptions, alias?: string, em?: SqlEntityManager): OracleQueryBuilder<T, any, any, any>;
|
|
11
11
|
nativeInsertMany<T extends object>(entityName: EntityName<T>, data: EntityDictionary<T>[], options?: NativeInsertUpdateManyOptions<T>): Promise<QueryResult<T>>;
|
|
12
|
+
protected getReturningFieldSQL(prop: EntityProperty, fieldName: string, index: number): string;
|
|
12
13
|
nativeUpdateMany<T extends object>(entityName: EntityName<T>, where: FilterQuery<T>[], data: EntityDictionary<T>[], options?: NativeInsertUpdateManyOptions<T> & UpsertManyOptions<T>): Promise<QueryResult<T>>;
|
|
13
14
|
/**
|
|
14
15
|
* Resolves the runtime type of every column a property maps to, aligned with its `fieldNames`.
|
package/OracleDriver.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { QueryFlag, ReferenceKind, Utils, } from '@mikro-orm/core';
|
|
2
2
|
import { AbstractSqlDriver } from '@mikro-orm/sql';
|
|
3
3
|
import { OracleConnection } from './OracleConnection.js';
|
|
4
4
|
import { OracleMikroORM } from './OracleMikroORM.js';
|
|
@@ -45,22 +45,20 @@ export class OracleDriver extends AbstractSqlDriver {
|
|
|
45
45
|
}
|
|
46
46
|
return res;
|
|
47
47
|
}
|
|
48
|
+
getReturningFieldSQL(prop, fieldName, index) {
|
|
49
|
+
// the value lands in a named OUT bind, and `returning ... into` does not allow column aliases
|
|
50
|
+
const quoted = this.platform.quoteIdentifier(fieldName);
|
|
51
|
+
const customType = prop.customTypes?.[index] ?? prop.customType;
|
|
52
|
+
if (prop.hasConvertToJSValueSQL && customType?.convertToJSValueSQL) {
|
|
53
|
+
return customType.convertToJSValueSQL(quoted, this.platform);
|
|
54
|
+
}
|
|
55
|
+
return quoted;
|
|
56
|
+
}
|
|
48
57
|
async nativeUpdateMany(entityName, where, data, options = {}) {
|
|
49
58
|
const meta = this.metadata.get(entityName);
|
|
50
|
-
const returning = new Set();
|
|
51
59
|
const into = [];
|
|
52
60
|
const outBindingsMap = {};
|
|
53
|
-
for (const
|
|
54
|
-
for (const k of Utils.keys(row)) {
|
|
55
|
-
if (isRaw(row[k])) {
|
|
56
|
-
returning.add(k);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
// reload generated columns and version fields
|
|
61
|
-
meta.props.filter(prop => prop.generated || prop.version || prop.primary).forEach(prop => returning.add(prop.name));
|
|
62
|
-
for (const propName of returning) {
|
|
63
|
-
const prop = meta.properties[propName];
|
|
61
|
+
for (const prop of this.getUpdateReturningProperties(meta, data)) {
|
|
64
62
|
// the parent builds the `returning` list from all field names, so every column needs its own OUT bind
|
|
65
63
|
const runtimeTypes = this.getOutBindTypes(prop);
|
|
66
64
|
prop.fieldNames.forEach((fieldName, idx) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/oracledb",
|
|
3
|
-
"version": "7.2.2-dev.
|
|
3
|
+
"version": "7.2.2-dev.7",
|
|
4
4
|
"description": "TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, MariaDB, PostgreSQL, SQLite, MSSQL and Oracle databases.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"data-mapper",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"copy": "node ../../scripts/copy.mjs"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@mikro-orm/sql": "7.2.2-dev.
|
|
45
|
+
"@mikro-orm/sql": "7.2.2-dev.7",
|
|
46
46
|
"kysely": "0.29.6",
|
|
47
47
|
"oracledb": "7.0.1"
|
|
48
48
|
},
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@mikro-orm/core": "^7.2.1"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
|
-
"@mikro-orm/core": "7.2.2-dev.
|
|
53
|
+
"@mikro-orm/core": "7.2.2-dev.7"
|
|
54
54
|
},
|
|
55
55
|
"engines": {
|
|
56
56
|
"node": ">= 22.17.0"
|