ChangeSetPersister
Index
Constructors
Methods
Constructors
constructor
Parameters
driver: IDatabaseDriver<Connection>
metadata: MetadataStorage
hydrator: IHydrator
factory: EntityFactory
validator: EntityValidator
config: Configuration<IDatabaseDriver<Connection>, EntityManager<IDatabaseDriver<Connection>>>
Returns ChangeSetPersister
Methods
executeDeletes
Type parameters
- T: object
Parameters
changeSets: ChangeSet<T>[]
optionaloptions: DriverMethodOptions
optionalwithSchema: boolean
Returns Promise<void>
executeInserts
Type parameters
- T: object
Parameters
changeSets: ChangeSet<T>[]
optionaloptions: DriverMethodOptions
optionalwithSchema: boolean
Returns Promise<void>
executeUpdates
Type parameters
- T: object
Parameters
changeSets: ChangeSet<T>[]
batched: boolean
optionaloptions: DriverMethodOptions
optionalwithSchema: boolean
Returns Promise<void>
mapReturnedValues
Type parameters
- T: object
Parameters
entity: undefined | null | T
payload: EntityDictionary<T>
row: undefined | Dictionary
meta: EntityMetadata<T>
upsert: boolean = false
Returns void
Maps values returned via
returning
statement (postgres) or the inserted id (other sql drivers). No need to handle composite keys here as they need to be set upfront. We do need to map to the change set payload too, as it will be used in the originalEntityData for new entities.