onRecord
function for complete control of message content. Result may be a table instead of a string to specify partition key, metadata, etc. See queue specific pages for supported fields. If multiple return values are given, multiple records will be written
For qrep mirrors transformRow
can be defined. Row fields can be set to transform row. Schema may not be modified
For cdc mirrors transformRow
will be called on the record’s rows by default, unless tranformRecord
is defined. The latter can be useful for comparing old & new field values
peerdb
functionspeerdb
table are:
RowColumns(row) table
RowColumnKind(row, column) string
Kind
of row column, see qvalue/kind.go for list of kinds
Now() [Time]
[Time]
UUID(string?) [UUID]
[UUID]
, or parses passed in string
Decimal(string | number)
type(any) string
fmt.Sprintf("%T", value)
on underlying value of UserData. Returns nil
for other types
tostring(any) string
fmt.Sprint(value)
on underlying value of UserData. Returns nil
for other types
Record
kind
insert
, update
, delete
, or relation
. You will likely want to ignore relation
messages
row
update
this is the new row. Keep in mind that Postgres does not send unchanged toast column values in CDC updates
old
nil
for insert
new
nil
for delete
checkpoint
commit_time
target
source
unchanged_columns
true
Row
__tostring
. Available types:
I64
/ U64
__tostring
support. There are 3 conversion properties:
i64
cast to [I64]
u64
cast to [U64]
float64
cast to lua numberhi
returns highest 32 bits as an unsigned numberlo
returns lowest 32 bits as an unsigned numberTime
[I64]
results, except unix
which is a lua number
UUID
[0..16)
to access bytes (first element at index 0)
BigInt
sign
1
, 0
, or -1
depending on sign of value
bytes
*big.Int
Bytes method
int64
[I64]
is64
int64
Decimal
coefficient
[BigInt]
representing digits
coefficient64
[I64]
representing digits
exponent
coefficient * (10 ^ exponent)
bigint
BigInt
int64
[I64]
float
require
:
library | description |
---|---|
bit32 | bit32 API included in Lua 5.2 |
json | JSON encoding/decoding |
msgpack | msgpack encoding |
utf8 | utf8 API included in Lua 5.3 |