diff options
Diffstat (limited to 'forged/internal/database/database.go')
-rw-r--r-- | forged/internal/database/database.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/forged/internal/database/database.go b/forged/internal/database/database.go index b995adc..f353fe8 100644 --- a/forged/internal/database/database.go +++ b/forged/internal/database/database.go @@ -19,7 +19,12 @@ type Database struct { // Open opens a new database connection pool using the provided connection // string. It returns a Database instance and an error if any occurs. // It is run indefinitely in the background. -func Open(connString string) (Database, error) { - db, err := pgxpool.New(context.Background(), connString) +func Open(ctx context.Context, config Config) (Database, error) { + db, err := pgxpool.New(ctx, config.Conn) return Database{db}, err } + +type Config struct { + Type string `scfg:"type"` + Conn string `scfg:"conn"` +} |