more index cleanups to optimise space
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2026-02-08 15:40:42 +11:00
parent a993aedf79
commit c66679a71f
13 changed files with 590 additions and 61 deletions

View File

@@ -5,7 +5,6 @@ import (
"embed"
"fmt"
"log/slog"
"os"
"reflect"
"strings"
@@ -24,8 +23,9 @@ type Database interface {
}
type Config struct {
Driver string
DSN string
Driver string
DSN string
EnableExperimentalPostgres bool
}
func New(logger *slog.Logger, cfg Config) (Database, error) {
@@ -42,8 +42,8 @@ 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")
if !cfg.EnableExperimentalPostgres {
return nil, fmt.Errorf("postgres driver is disabled by default; set settings.enable_experimental_postgres=true to enable experimental mode")
}
db, err := newPostgresDB(logger, cfg.DSN)
if err != nil {