Add meilisearch for user and event
Signed-off-by: Asai Neko <sugar@sne.moe>
This commit is contained in:
@@ -16,9 +16,9 @@ func SplitHostPort(url string) (host, port string) {
|
||||
return split[0], split[1]
|
||||
}
|
||||
|
||||
func Postgres(dsn ExternalDSN) (*DBClient, error) {
|
||||
func Postgres(dsn ExternalDSN) (*gorm.DB, error) {
|
||||
host, port := SplitHostPort(dsn.Host)
|
||||
conn := "host=" + host + " user=" + dsn.Username + " password=" + dsn.Password + " dbname=" + dsn.Name + " port=" + port + " sslmode=disable TimeZone=" + config.TZ()
|
||||
db, err := gorm.Open(postgres.Open(conn), &gorm.Config{})
|
||||
return &DBClient{db}, err
|
||||
return db, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user