-
Notifications
You must be signed in to change notification settings - Fork 33
Upgrade to modules, pgx/v4 & accoutrements - WIP #36
base: master
Are you sure you want to change the base?
Upgrade to modules, pgx/v4 & accoutrements - WIP #36
Conversation
if cfg.Postgres.Host == "" { | ||
cfg.Postgres.Host = defaultPostgresHost | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pgx/v4
favors taking pg connection as input via a connection string in either url or dsn format.
conn *pgx.ReplicationConn | ||
dbCfg pgx.ConnConfig | ||
conn *pgconn.PgConn | ||
dbCfg pgconn.Config |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lots of changes like this where will now be referencing repos that were spun-out of the main pgx
repo as of version 4.
|
||
} | ||
default: | ||
log.Printf("Received unexpected message: %#v\n", repMsg) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is copypasta from an example in pglogrepl
and could use careful review.
@@ -111,7 +111,7 @@ func (r *Replicator) newTable(tblName config.PgTableName, tblConfig config.Table | |||
func (r *Replicator) checkPgSlotAndPub(tx *pgx.Tx) error { | |||
var slotExists, pubExists bool | |||
|
|||
err := tx.QueryRow("select "+ | |||
err := (*tx).QueryRow(r.ctx, "select "+ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lots of changes like this (tx
=> *tx
) now that go doesn't automatically dereference pointers to interfaces.
@mkabilov @mattTruebill any news on this? I am not able to install pg2ch. Right now I am getting this: go get -u github.com/mkabilov/pg2ch
|
Hello @mkabilov and @mattTruebill - thanks for your hard work on this project. Do either of you have an ETA when this PR will be pulled in? I have an outstanding issue where pg2ch will not handle DateTime64 CH fields due to the underlying ch-go library not supporting them. This has been fixed in the current version of clickhouse-go which is being pulled in via gomod dependency management. |
You can clone the repository and build locally. Until this PR Is merged |
Upgrade to using go modules.
Upgrade to pgx/4.