fix(db): added SSL config to migrations container#1535
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
There was a problem hiding this comment.
Greptile Overview
Summary
This PR adds SSL configuration support to the Drizzle ORM migration configuration file (`packages/db/drizzle.config.ts`). The change introduces a comprehensive `getSSLConfig()` function that handles various SSL modes including `disable`, `prefer`, `require`, `verify-ca`, and `verify-full`. The function properly parses base64-encoded SSL certificates from environment variables and conditionally applies the SSL configuration to the database credentials.The implementation addresses a parity issue where the migrations container lacked the SSL configuration that was present in the primary application. This ensures that database migrations can run successfully in environments requiring SSL connections, particularly in production deployments where SSL is mandatory for security compliance. The SSL config is conditionally spread into the dbCredentials object only when SSL is configured, maintaining backwards compatibility with non-SSL environments.
Important Files Changed
Changed Files
| Filename | Score | Overview |
|---|---|---|
| packages/db/drizzle.config.ts | 4/5 | Added comprehensive SSL configuration support with multi-mode handling and certificate parsing |
Confidence score: 4/5
- This PR is safe to merge with minimal risk as it adds defensive SSL configuration handling
- Score reflects well-structured error handling and backwards compatibility preservation
- No files require special attention beyond standard code review practices
1 file reviewed, 1 comment
| return 'prefer' as const | ||
| } | ||
|
|
||
| const sslConfig: any = {} |
There was a problem hiding this comment.
style: Using any type bypasses TypeScript's type safety. Consider defining a proper interface for SSL configuration or using Record<string, unknown>.
| const sslConfig: any = {} | |
| const sslConfig: Record<string, unknown> = {} |
Context Used: Context from dashboard - Avoid using type assertions to 'any' in TypeScript. Instead, ensure proper type definitions are used... (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/db/drizzle.config.ts
Line: 14:14
Comment:
**style:** Using `any` type bypasses TypeScript's type safety. Consider defining a proper interface for SSL configuration or using `Record<string, unknown>`.
```suggestion
const sslConfig: Record<string, unknown> = {}
```
**Context Used:** Context from `dashboard` - Avoid using type assertions to 'any' in TypeScript. Instead, ensure proper type definitions are used... ([source](https://app.greptile.com/review/custom-context?memory=c63aedff-69e6-48d8-81cf-9763416ee01c))
How can I resolve this? If you propose a fix, please make it concise.
Summary
added SSL config to migrations container, to have parity with the primary app
Type of Change
Testing
Manually.
Checklist