MCPcopy Create free account
hub / github.com/dolthub/doltgresql / newReplicator

Function newReplicator

testing/go/replication_test.go:571–581  ·  view source on GitHub ↗
(t *testing.T, walFilePath string, replicaConn *pgx.Conn, primaryDns string)

Source from the content-addressed store, hash-verified

569}
570
571func newReplicator(t *testing.T, walFilePath string, replicaConn *pgx.Conn, primaryDns string) *logrepl.LogicalReplicator {
572 connString := replicaConn.PgConn().Conn().RemoteAddr().String()
573 _, port, err := net.SplitHostPort(connString)
574 require.NoError(t, err)
575
576 replicaDns := fmt.Sprintf("postgres://postgres:password@127.0.0.1:%s/", port)
577
578 r, err := logrepl.NewLogicalReplicator(walFilePath, primaryDns, replicaDns)
579 require.NoError(t, err)
580 return r
581}
582
583// runReplicationScript runs the script given on the postgres connection provided. This does not handle assertions that
584// use ExpectedRaw.

Callers 1

runReplicationScriptFunction · 0.85

Calls 3

NewLogicalReplicatorFunction · 0.92
ConnMethod · 0.80
StringMethod · 0.65

Tested by

no test coverage detected