wal2json
wal2json copied to clipboard
Add Support for Key Value Hash
This will add support for outputting change data in a key value hash rather than a series of arrays (see #71) and is enabled by setting the use-key-value-hash to 1.
Once enabled, the changes will be outputted as follows:
{
"change": [
{
"kind": "insert",
"schema": "public",
"table": "table_with_pk",
"changes": {
"a": 2,
"b": 1,
"c": 2,
"d": 3,
"e": 3.540,
"f": 876.563,
"g": 1.23,
"h": "teste ",
"i": "testando",
"j": "um texto longo",
"k": "001110010101010",
"l": "Sat Nov 02 17:30:52 2013",
"m": "02-04-2013",
"n": true,
"o": "{ \"a\": 123 }",
"p": "'Old' 'Parr'"
},
"columntypes": {
"a": "smallint",
"b": "smallint",
"c": "integer",
"d": "bigint",
"e": "numeric(5,3)",
"f": "real",
"g": "double precision",
"h": "character(10)",
"i": "character varying(30)",
"j": "text",
"k": "bit varying(20)",
"l": "timestamp without time zone",
"m": "date",
"n": "boolean",
"o": "json",
"p": "tsvector"
}
}
]
}