IWriter<T, K>

Interface for data processing components that can create, update and delete data items.

Description

The IWriter interface is used by data processng components that can create, update and delete data items.

Instance methods

create

Creates a data item.

create(correlationId: string, item: T): Promise<T>

  • correlationId: string - (optional) transaction id used to trace execution through the call chain.
  • item: T - item to be created.
  • returns: T - created item

update

Updates a data item.

update(correlationId: string, item: T): Promise<T>

  • correlationId: string - (optional) transaction id used to trace execution through the call chain.
  • item: T - item to be updated.
  • returns: Promise<T> - updated item

deleteById

Updates a data item.

deleteById(correlationId: string, id: K): Promise<T>

  • correlationId: string - (optional) transaction id used to trace execution through the call chain.
  • id: K - id of the item to be deleted
  • returns: Promise<T> - deleted item.