Skip to content

Commit

Permalink
refactor: remove Oracle multirow insert workaround (since #6927) (#7083)
Browse files Browse the repository at this point in the history
  • Loading branch information
nebkat committed Jan 11, 2021
1 parent 9407507 commit d44f2bc
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions src/entity-manager/EntityManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import {ObjectID} from "../driver/mongodb/typings";
import {InsertResult} from "../query-builder/result/InsertResult";
import {UpdateResult} from "../query-builder/result/UpdateResult";
import {DeleteResult} from "../query-builder/result/DeleteResult";
import {OracleDriver} from "../driver/oracle/OracleDriver";
import {FindConditions} from "../find-options/FindConditions";
import {IsolationLevel} from "../driver/types/IsolationLevel";
import {ObjectUtils} from "../util/ObjectUtils";
Expand Down Expand Up @@ -457,11 +456,6 @@ export class EntityManager {
* You can execute bulk inserts using this method.
*/
async insert<Entity>(target: EntityTarget<Entity>, entity: QueryDeepPartialEntity<Entity>|(QueryDeepPartialEntity<Entity>[])): Promise<InsertResult> {
// TODO: Oracle does not support multiple values. Need to create another nice solution.
if (this.connection.driver instanceof OracleDriver && Array.isArray(entity)) {
const results = await Promise.all(entity.map(entity => this.insert(target, entity)));
return results.reduce((mergedResult, result) => Object.assign(mergedResult, result), {} as InsertResult);
}
return this.createQueryBuilder()
.insert()
.into(target)
Expand Down

0 comments on commit d44f2bc

Please sign in to comment.