simplify production database configuration
This commit is contained in:
1 parent
8cb8b5e463
commit
b26f9679ab
17 files changed
+199
-234
No files matched your search
@@ -42,7 +42,7 @@ func Open(ctx context.Context, config Config) (*Module, error) {
|
||||
poolConfig.ConnConfig.Fallbacks = nil
|
||||
case SSLVerifyFull:
|
||||
if config.TLSConfig == nil {
|
||||
return nil, fmt.Errorf("TLS configuration is required when DATABASE_SSL_MODE=verify-full")
|
||||
return nil, fmt.Errorf("TLS configuration is required when DATABASE_URL sslmode=verify-full")
|
||||
}
|
||||
tlsConfig := config.TLSConfig.Clone()
|
||||
if tlsConfig.ServerName == "" {
|
||||
@@ -51,7 +51,7 @@ func Open(ctx context.Context, config Config) (*Module, error) {
|
||||
poolConfig.ConnConfig.TLSConfig = tlsConfig
|
||||
poolConfig.ConnConfig.Fallbacks = nil
|
||||
default:
|
||||
return nil, fmt.Errorf("unsupported DATABASE_SSL_MODE %q", config.SSLMode)
|
||||
return nil, fmt.Errorf("unsupported DATABASE_URL sslmode %q", config.SSLMode)
|
||||
}
|
||||
pool, err := pgxpool.NewWithConfig(ctx, poolConfig)
|
||||
if err != nil {
|
||||
|
||||
Reference in new issue
Block a user