Skip to content

feat: add SSL mode configuration support#75

Closed
IAkumaI wants to merge 1 commit intopgplex:mainfrom
IAkumaI:sslmode-support
Closed

feat: add SSL mode configuration support#75
IAkumaI wants to merge 1 commit intopgplex:mainfrom
IAkumaI:sslmode-support

Conversation

@IAkumaI
Copy link

@IAkumaI IAkumaI commented Oct 12, 2025

Add --sslmode CLI parameter and PGSSLMODE environment variable support for all database connection commands (dump, plan, apply).

Changes:

  • Add --sslmode flag to dump, plan, and apply commands
  • Support PGSSLMODE environment variable with fallback to 'prefer'
  • Update PlanConfig struct to include SSLMode field
  • Add GetIRFromDatabaseWithSSLMode and GetIRFromDatabaseWithIgnoreConfigAndSSLMode utility functions for custom SSL mode connections
  • Maintain backward compatibility - existing code uses 'prefer' by default
  • Add nil checks for cmd parameter in tests

Supported SSL modes: disable, allow, prefer, require, verify-ca, verify-full
Default: prefer

Priority: CLI flag → PGSSLMODE env var → default value

Examples:
pgschema dump --sslmode require --host localhost --db mydb --user postgres PGSSLMODE=require pgschema plan --file schema.sql --host localhost --db mydb --user postgres

Add --sslmode CLI parameter and PGSSLMODE environment variable support
for all database connection commands (dump, plan, apply).

Changes:
- Add --sslmode flag to dump, plan, and apply commands
- Support PGSSLMODE environment variable with fallback to 'prefer'
- Update PlanConfig struct to include SSLMode field
- Add GetIRFromDatabaseWithSSLMode and GetIRFromDatabaseWithIgnoreConfigAndSSLMode
  utility functions for custom SSL mode connections
- Maintain backward compatibility - existing code uses 'prefer' by default
- Add nil checks for cmd parameter in tests

Supported SSL modes: disable, allow, prefer, require, verify-ca, verify-full
Default: prefer

Priority: CLI flag → PGSSLMODE env var → default value

Examples:
  pgschema dump --sslmode require --host localhost --db mydb --user postgres
  PGSSLMODE=require pgschema plan --file schema.sql --host localhost --db mydb --user postgres
@tianzhou
Copy link
Contributor

@IAkumaI thank you for the PR. Could you please open an issue instead with your exact requirement? The ssl stuff is more complicated. a single sslmode is not sufficient.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants