feat: uniq tenant_users
This commit is contained in:
26
backend/fixtures/db.go
Normal file
26
backend/fixtures/db.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package fixtures
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
|
||||
// . "github.com/go-jet/jet/v2/postgres"
|
||||
_ "github.com/lib/pq"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
func GetDB() (*sql.DB, error) {
|
||||
logrus.SetLevel(logrus.DebugLevel)
|
||||
|
||||
dsn := "postgres://postgres:xixi0202@10.1.1.3:5432/qvyun?sslmode=disable"
|
||||
db, err := sql.Open("postgres", dsn)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
err = db.Ping()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return db, nil
|
||||
}
|
||||
Reference in New Issue
Block a user