Skip to content

Commit

Permalink
feat: add cloudsql
Browse files Browse the repository at this point in the history
  • Loading branch information
gllm-dev committed Mar 27, 2024
1 parent 84c64d7 commit 3cc6b96
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/infrastructure/repositories/sql/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ type Config struct {
TimeZone string `env:"DB_POSTGRES_TIME_ZONE" envDefault:"Europe/Madrid"`

// CloudSQL
UnixSocketPAth string `env:"INSTANCE_UNIX_SOCKET"`
InstanceHost string `env:"INSTANCE_HOST"`
}

const migrationDirectory = "internal/infrastructure/repositories/sql/migrations"
Expand All @@ -43,8 +43,8 @@ func (c *Config) MySQLDSN() string {
}

func (c *Config) CloudSQLDSN() string {
return fmt.Sprintf("%s:%s@unix(%s)/%s?parseTime=true",
c.User, c.Pass, c.UnixSocketPAth, c.DBName)
return fmt.Sprintf("%s:%s@tcp(%s:%s)/%s?parseTime=true",

Check failure on line 46 in internal/infrastructure/repositories/sql/config.go

View workflow job for this annotation

GitHub Actions / Test and Lint

fmt.Sprintf format %s has arg c.Port of wrong type int
c.User, c.Pass, c.InstanceHost, c.Port, c.DBName)
}

func (c *Config) PostgresDSN() string {
Expand Down

0 comments on commit 3cc6b96

Please sign in to comment.