Skip to content
Discussion options

You must be logged in to vote

I was wondering if there were any examples of this around anywhere.

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:

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 CommitPosition for checkpointing) and do whatever you like with it. The stdout writer (pkg/wal/processor/stdout/wal_stdout_writer.go) is the simplest reference to copy from, and targets are wired up in buildProcessor() in pkg/stream/stream.go.

co…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by kvch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants