Skip to main content

CrudEntry

A single client-side change.

Constructors

new CrudEntry()

new CrudEntry(
clientId,
op,
table,
id,
transactionId?,
opData?,
previousValues?,
metadata?): CrudEntry

Parameters

ParameterType
clientIdnumber
opUpdateType
tablestring
idstring
transactionId?number
opData?Record<string, any>
previousValues?Record<string, any>
metadata?string

Returns

CrudEntry

Properties

PropertyTypeDescription
clientIdnumberAuto-incrementing client-side id.
idstringID of the changed row.
metadata?stringClient-side metadata attached with this write. This field is only available when the trackMetadata option was set to true when creating a table and the insert or update statement set the _metadata column.
opUpdateTypeType of change.
opData?Record<string, any>Data associated with the change.
previousValues?Record<string, any>For tables where the trackPreviousValues option has been enabled, this tracks previous values for UPDATE and DELETE statements.
tablestringTable that contained the change.
transactionId?numberAuto-incrementing transaction id. This is the same for all operations within the same transaction.

Methods

equals()

equals(entry): boolean

Parameters

ParameterType
entryCrudEntry

Returns

boolean


hashCode()

hashCode(): string

The hash code for this object.

Returns

string

Deprecated

This should not be necessary in the JS SDK. Use the

See

CrudEntry#equals method instead. TODO remove in the next major release.


toComparisonArray()

toComparisonArray(): (undefined | string | number | Record<string, any>)[]

Generates an array for use in deep comparison operations

Returns

(undefined | string | number | Record<string, any>)[]


toJSON()

toJSON(): CrudEntryOutputJSON

Converts the change to JSON format.

Returns

CrudEntryOutputJSON


fromRow()

static fromRow(dbRow): CrudEntry

Parameters

ParameterType
dbRowCrudEntryJSON

Returns

CrudEntry