[ci skip] codex 5.3 review

This commit is contained in:
2026-02-06 15:07:44 +11:00
parent 5dcc11e5e0
commit dc96431f06
8 changed files with 179 additions and 339 deletions

View File

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