Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions internal/db/diff/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,10 @@ func CreateShadowDatabase(ctx context.Context, port uint16) (string, error) {
func ConnectShadowDatabase(ctx context.Context, timeout time.Duration, options ...func(*pgx.ConnConfig)) (conn *pgx.Conn, err error) {
// Retry until connected, cancelled, or timeout
policy := start.NewBackoffPolicy(ctx, timeout)
config := pgconn.Config{Port: utils.Config.Db.ShadowPort}
config := pgconn.Config{
Host: utils.Config.Db.ShadowHost,
Port: utils.Config.Db.ShadowPort,
}
connect := func() (*pgx.Conn, error) {
return utils.ConnectLocalPostgres(ctx, config, options...)
}
Expand Down Expand Up @@ -201,7 +204,7 @@ func DiffDatabase(ctx context.Context, schema []string, config pgconn.Config, w
}
fmt.Fprintln(w, "Diffing schemas:", strings.Join(schema, ","))
source := utils.ToPostgresURL(pgconn.Config{
Host: utils.Config.Hostname,
Host: utils.Config.Db.ShadowHost,
Port: utils.Config.Db.ShadowPort,
User: "postgres",
Password: utils.Config.Db.Password,
Expand Down
2 changes: 2 additions & 0 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,8 @@ func NewConfig(editors ...ConfigEditor) config {
Enabled: true,
GlobPatterns: []string{"./seed.sql"},
},
ShadowHost: "127.0.0.1",
ShadowPort: 54320,
},
Realtime: realtime{
Image: realtimeImage,
Expand Down
1 change: 1 addition & 0 deletions pkg/config/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ type (
Image string `toml:"-"`
Port uint16 `toml:"port"`
ShadowPort uint16 `toml:"shadow_port"`
ShadowHost string `toml:"shadow_host"`
MajorVersion uint `toml:"major_version"`
Password string `toml:"-"`
RootKey string `toml:"-" mapstructure:"root_key"`
Expand Down
Loading