Open scythargon opened 6 months ago
Hi, @scythargon :) Because the data transmitted from the server is passed through without modification, the oldKeys field is included in the response. However, it is missing from the TypeScript interface, which I will update soon.
@scythargon
I've published version 2.0.6 of the npm package with only minor changes. Unfortunately, I was not able to define the type as a union type based on the values of Change.kind('insert' | 'update' | 'delete' | 'message' | 'truncate')
. If you're interested, I would appreciate your contribution. :)
Hey! Thanks!:) I didn't get what you mean by the type issue, could you elaborate please?
https://github.com/kibae/pg-logical-replication/blob/15930f2a2953e84ee1d71dee8449833ebb917162/src/output-plugins/wal2json/wal2json-plugin-output.type.ts#L26-L28 In TypeScript, there is a feature called union type. You can define a type such that the oldKeys value exists only when the kind of Change is either 'update' or 'delete', based on the value of kind.
https://www.typescriptlang.org/docs/handbook/unions-and-intersections.html#discriminating-unions
Hi! First of all - thank you for you library! It's great!
But currently when used with wal2json - it does not allow to determine which row was deleted or updated, right?
Because
oldKeys
is not present in the lib source, I believe.Here it is in wal2json readme:
Do you have plans to add it? Or will you be fine if I submit a MR?
Thank you again.