(sqlCtx *sql.Context, t *testing.T, primaryDns string)
| 719 | } |
| 720 | |
| 721 | func newReplicator(sqlCtx *sql.Context, t *testing.T, primaryDns string) *logrepl.LogicalReplicator { |
| 722 | err := logrepl.CreateSubscription(sqlCtx, subscriptionName, primaryDns, slotName, pglogrepl.LSN(0).String(), true) |
| 723 | require.NoError(t, err) |
| 724 | |
| 725 | tx := adapter.TryGetTxn(sqlCtx) |
| 726 | if tx != nil { |
| 727 | err := tx.Commit() |
| 728 | require.NoError(t, err) |
| 729 | adapter.CloseTxn(sqlCtx) |
| 730 | } |
| 731 | |
| 732 | r, err := logrepl.NewLogicalReplicator(subscriptionName, primaryDns) |
| 733 | require.NoError(t, err) |
| 734 | return r |
| 735 | } |
| 736 | |
| 737 | // runReplicationScript runs the script given on the postgres connection provided |
| 738 | func runReplicationScript( |
no test coverage detected