-
Notifications
You must be signed in to change notification settings - Fork 28
feat: add environment file support and upgrade dependencies #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
refactor: updgrade to psycopg2 and rich v14 Co-authored-by: Ahmad Balkiss <[email protected]>
|
Love the idea, will get this pulled in |
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for loading configuration from an environment file and updates key dependencies for better performance.
- Introduces a
--env-fileCLI option withload_env_file()andget_config_from_env() - Refactors database setup functions to accept environment parameters
- Switches from
psycopgtopsycopg2and updates README with env-file usage
Reviewed Changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| migrate.py | Added load_env_file, get_config_from_env, updated migrate signature to accept env inputs, and swapped psycopg → psycopg2 |
| README.md | Documented environment-file mode in features list and configuration section, plus CLI examples |
Comments suppressed due to low confidence (3)
README.md:14
- Replace the placeholder '�' with the intended emoji (for example, 🆕 or 📂) or remove it to correct the feature bullet.
- � **Environment file support for automated deployments**
README.md:105
- [nitpick] The code also supports
POSTGRES_DATABASEas an alternative for the database name inget_config_from_env. Consider adding it here for completeness.
- `PG_HOST`, `PG_PORT`, `PG_DATABASE`, `PG_USER`, `PG_PASSWORD`
migrate.py:605
- Add unit tests for
load_env_fileandget_config_from_envto cover valid parsing, skipping malformed lines, missing files, and connection validation.
def load_env_file(env_file_path: Path) -> Dict[str, str]:
Co-authored-by: Copilot <[email protected]>
New Features & Improvements
This PR introduces environment file support for automated deployments and upgrades key dependencies for better performance and compatibility.
Environment File Support
--env-fileCLI parameter for automated configurationSQLITE_DB_PATH- SQLite database pathPOSTGRES_HOST/PG_HOST- PostgreSQL hostPOSTGRES_PORT/PG_PORT- PostgreSQL portPOSTGRES_DB/PG_DATABASE- Database namePOSTGRES_USER/PG_USER- UsernamePOSTGRES_PASSWORD/PG_PASSWORD- PasswordPOSTGRES_*andPG_*prefixesTechnical Improvements
Dependency Upgrades:
psycopg2-binary→psycopg22.9.10 (better performance, reduced binary size)rich→ 14.0.0 (latest features and bug fixes)Code Enhancements:
load_env_file()function for parsing environment filesget_config_from_env()function for extracting configurationget_sqlite_config()andget_pg_config()to accept environment parameters