|
The readme suggests that there is support for "Extendable support for custom targets". I was wondering if there were any examples of this around anywhere. Also, could this support streaming pg->pg (with a different schema name). Thanks! |
Replies: 1 comment
Unfortunately, we do not have a tutorial for this. The extensibility comes from using pgstream as a Go library. A target is anything implementing the Processor interface in type Processor interface {
ProcessWALEvent(ctx context.Context, walEvent *wal.Event) error
Close() error
Name() string
}You get a *wal.Event (DML or DDL, plus a
Yes, it can. The Postgres target writes using the source schema name directly. The cleanest way to achieve it right now is exactly the custom-target route above: a small |
Unfortunately, we do not have a tutorial for this. The extensibility comes from using pgstream as a Go library. A target is anything implementing the Processor interface in
pkg/wal/processor/wal_processor.go:You get a *wal.Event (DML or DDL, plus a
CommitPositionfor checkpointing) and do whatever you like with it. Thestdoutwriter (pkg/wal/processor/stdout/wal_stdout_writer.go) is the simplest reference to copy from, and targets are wired up inbuildProcessor()inpkg/stream/stream.go.