Skip to content

Commit

Permalink
fix: Remove Oracle multirow insert workaround (since typeorm#6927)
Browse files Browse the repository at this point in the history
  • Loading branch information
nebkat committed Nov 18, 2020
1 parent c4a36da commit 577b1c3
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions src/entity-manager/EntityManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -457,11 +457,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 577b1c3

Please sign in to comment.