Upgraded to go1.22 + replaced log with slog

This commit is contained in:
brajkovic committed 2024-04-01 11:09:54 +02:00
1 parent 67c72e8b4f
commit b4288b2abb
9 files changed
+97 -43

No files matched your search

+3 -3
View File
@@ -12,9 +12,9 @@ var DevMigrations embed.FS
//go:embed prod/*.sql
var ProdMigrations embed.FS
func ConnectToDbNamed(host string, port string, user string, password string, dbname string) (*sqlx.DB, error) {
psqlInfo := fmt.Sprintf("host=%s port=%s user=%s password=%s dbname=%s sslmode=disable",
host, port, user, password, dbname)
func ConnectToDbNamed(host string, port string, user string, password string, dbname string, sslMode string, schema string) (*sqlx.DB, error) {
psqlInfo := fmt.Sprintf("host=%s port=%s user=%s password=%s dbname=%s sslmode=%s search_path=%s",
host, port, user, password, dbname, sslMode, schema)
db, err := sqlx.Open("postgres", psqlInfo)
if err != nil {