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
Parameters
changeSets: ChangeSet<T>[]
optionaloptions: DriverMethodOptions
optionalwithSchema: boolean
Returns Promise<void>
executeInserts
Parameters
changeSets: ChangeSet<T>[]
optionaloptions: DriverMethodOptions
optionalwithSchema: boolean
Returns Promise<void>
executeUpdates
Parameters
changeSets: ChangeSet<T>[]
batched: boolean
optionaloptions: DriverMethodOptions
optionalwithSchema: boolean
Returns Promise<void>
mapReturnedValues
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.