more index cleanups to optimise space
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
10
db/db.go
10
db/db.go
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user