Add meilisearch for user and event

Signed-off-by: Asai Neko <sugar@sne.moe>
This commit is contained in:
2025-12-26 02:16:23 +08:00
parent 3dbcc00a2d
commit 6681ffccdf
19 changed files with 229 additions and 15 deletions

View File

@@ -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
}