Documentation
¶
Overview ¶
Package pglogical contains support for reading a PostgreSQL logical replication feed.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Set = wire.NewSet( ProvideConn, ProvideEagerConfig, ProvideSchemaWatchConfig, )
Set is used by Wire.
Functions ¶
func ProvideSchemaWatchConfig ¶ added in v1.0.5
func ProvideSchemaWatchConfig(cfg *Config) *schemawatch.Config
ProvideSchemaWatchConfig is called by Wire.
Types ¶
type Config ¶
type Config struct {
DLQ dlq.Config
SchemaWatch schemawatch.Config
Script script.Config
Sequencer sequencer.Config
Stage stage.Config // Staging table configuration.
Staging sinkprod.StagingConfig // Staging database configuration.
Target sinkprod.TargetConfig
// The name of the publication to attach to.
Publication string
// The replication slot to attach to.
Slot string
// How ofter to report progress to the source database.
StandbyTimeout time.Duration
// Connection string for the source db.
SourceConn string
// The SQL schema in the target cluster to write into. This value is
// optional if a userscript dispatch function is present.
TargetSchema ident.Schema
// Enable support for toasted columns
ToastedColumns bool
}
Config contains the configuration necessary for creating a replication connection. All field, other than TestControls, are mandatory unless explicitly indicated.
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
A Conn encapsulates all wire-connection behavior. It is responsible for receiving replication messages and replying with status updates.
func ProvideConn ¶
func ProvideConn( ctx *stopper.Context, acc *apply.Acceptor, chaos *chaos.Chaos, config *Config, imm *immediate.Immediate, memo types.Memo, scriptSeq *script.Sequencer, stagingPool *types.StagingPool, targetPool *types.TargetPool, watchers types.Watchers, ) (*Conn, error)
ProvideConn is called by Wire to construct a connection to the source database. This provider will perform some pre-flight tests on the source database to ensure that replication has been configured. There's a fake dependency on the script loader so that flags can be evaluated first.
type EagerConfig ¶
type EagerConfig Config
EagerConfig is a hack to get Wire to move userscript evaluation to the beginning of the injector. This allows CLI flags to be set by the script.
func ProvideEagerConfig ¶
func ProvideEagerConfig(cfg *Config, _ *scriptRT.Loader) (*EagerConfig, error)
ProvideEagerConfig is a hack to move up the evaluation of the user script so that the options callbacks can set any non-script-related CLI flags. The configuration will be preflighted.
type PGLogical ¶
type PGLogical struct {
Conn *Conn
Diagnostics *diag.Diagnostics
Memo types.Memo // Support testing.
}
PGLogical is a PostgreSQL logical replication loop.
func (*PGLogical) GetDiagnostics ¶
func (l *PGLogical) GetDiagnostics() *diag.Diagnostics
GetDiagnostics implements stdlogical.HasDiagnostics.