From f4da943b5d98a9e16c14cad7e0406fd379a6b77d Mon Sep 17 00:00:00 2001 From: Nam Huynh Date: Mon, 9 Aug 2021 10:30:00 +0700 Subject: [PATCH] init module --- postgresql.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/postgresql.go b/postgresql.go index 56bb30d..7133c6a 100644 --- a/postgresql.go +++ b/postgresql.go @@ -15,13 +15,15 @@ var ( sqlxClient *sqlx.DB ) -// Connect to postgres database +// Connect to postgresql database func Connect(host, user, password, dbname, port, sslmode string) error { // Connect string dsn := fmt.Sprintf("host=%s user=%s password=%s dbname=%s port=%s sslmode=%s TimeZone=UTC", host, user, password, dbname, port, sslmode, ) + // TODO: write case for SSL mode + db, err := sqlx.Connect("postgres", dsn) if err != nil { log.Fatalln(err)