diff --git a/src/entity-manager/EntityManager.ts b/src/entity-manager/EntityManager.ts index cc5616b48a..18216930b6 100644 --- a/src/entity-manager/EntityManager.ts +++ b/src/entity-manager/EntityManager.ts @@ -291,13 +291,25 @@ export class EntityManager { * Saves all given entities in the database. * If entities do not exist in the database then inserts, otherwise updates. */ - save>(targetOrEntity: EntityTarget, entities: T[], options?: SaveOptions): Promise; + save>(targetOrEntity: EntityTarget, entities: T[], options: SaveOptions & { reload: false }): Promise; /** * Saves all given entities in the database. * If entities do not exist in the database then inserts, otherwise updates. */ - save>(targetOrEntity: EntityTarget, entity: T, options?: SaveOptions): Promise; + save>(targetOrEntity: EntityTarget, entities: T[], options?: SaveOptions): Promise<(T & Entity)[]>; + + /** + * Saves a given entity in the database. + * If entity does not exist in the database then inserts, otherwise updates. + */ + save>(targetOrEntity: EntityTarget, entity: T, options: SaveOptions & { reload: false }): Promise; + + /** + * Saves a given entity in the database. + * If entity does not exist in the database then inserts, otherwise updates. + */ + save>(targetOrEntity: EntityTarget, entity: T, options?: SaveOptions): Promise; /** * Saves a given entity in the database.