shad-go/lectures/07-sql/open/sql.go
2020-04-08 22:20:23 +03:00

11 lines
201 B
Go

import (
"database/sql"
_ "github.com/jackc/pgx/v4/stdlib"
)
db, err := sql.Open("pgx", "postgres://pgx_md5:secret@localhost:5432/pgx_test")
if err != nil {
return err
}
defer db.Close()