Initial commit

This commit is contained in:
2026-01-19 12:12:29 +07:00
commit 2072052437
42 changed files with 5450 additions and 0 deletions

17
pkg/database/postgres.go Normal file
View File

@@ -0,0 +1,17 @@
package database
import (
"fmt"
"gorm.io/driver/postgres"
"gorm.io/gorm"
)
func Connect(dsn string) (*gorm.DB, error) {
db, err := gorm.Open(postgres.Open(dsn), &gorm.Config{})
if err != nil {
return nil, fmt.Errorf("failed to connect to database: %w", err)
}
return db, nil
}