[ci skip] codex 5.3 review
This commit is contained in:
5
db/db.go
5
db/db.go
@@ -5,6 +5,7 @@ import (
|
||||
"embed"
|
||||
"fmt"
|
||||
"log/slog"
|
||||
"os"
|
||||
"reflect"
|
||||
"strings"
|
||||
|
||||
@@ -40,6 +41,10 @@ func New(logger *slog.Logger, cfg Config) (Database, error) {
|
||||
}
|
||||
return db, nil
|
||||
case "postgres":
|
||||
// The sqlc query set is SQLite-first. Keep Postgres opt-in until full parity is validated.
|
||||
if strings.TrimSpace(os.Getenv("VCTP_ENABLE_EXPERIMENTAL_POSTGRES")) != "1" {
|
||||
return nil, fmt.Errorf("postgres driver is disabled by default; set VCTP_ENABLE_EXPERIMENTAL_POSTGRES=1 to enable experimental mode")
|
||||
}
|
||||
db, err := newPostgresDB(logger, cfg.DSN)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user