feat(api): allow choosing MySQL or PostgreSQL via DB_ENGINE#151
Merged
Conversation
Developers can now pick sqlite, mysql, or postgres at startup through a single DB_ENGINE setting, with Docker Compose profiles and local dev containers aligned on the same configuration. Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(api): support emoji and punycode domains in analysis tasks WebPage validation stores URLs as Unicode, which breaks requests for emoji domains like xn--3s8h30f.ws. Use AnyHttpUrl for punycode conversion and pass the encoded URL to the worker queue. Fixes cnumr/EcoIndex#416 Co-authored-by: Cursor <cursoragent@cursor.com> * fix(api): include request error details when URL pre-check fails Expose SSL, timeout, and DNS errors in the unreachable URL response instead of empty parentheses. Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com>
Use an empty default and resolve it in the model validator so type checkers accept Settings().DATABASE_URL where a str is required. Co-authored-by: Cursor <cursoragent@cursor.com>
Branch coverage •
|
||||||||||||||||||||
Alembic needs projects/ecoindex_api as the working directory so it can find alembic.ini and load the local .env during init-dev-project. Co-authored-by: Cursor <cursoragent@cursor.com>
Ensure mysql/postgres containers are up before migration-upgrade and document which DB_HOST to use for local dev versus Docker Compose. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
DB_ENGINE(sqlite,mysql,postgres) to buildDATABASE_URLautomatically, with optional explicit overridedb-mysqlanddb-postgresprofiles and add Task commands for each enginestart_dev_infra.shbased onDB_ENGINE, withaiomysqlandasyncpgdriversTest plan
uv run pytest test/components/ecoindex/config/test_settings.pyDB_ENGINE=sqlite task api:start-dev— API starts with local SQLite fileDB_ENGINE=mysql task api:start-dev— MySQL container starts, migrations apply, API responds on/healthDB_ENGINE=postgres task api:start-dev— PostgreSQL container starts, migrations apply, API responds on/healthtask api:docker-up-mysql -- -d— full stack starts with MySQL profiletask api:docker-up-postgres -- -d— full stack starts with PostgreSQL profileMade with Cursor