is that correct config = context.config section = config.configinisection…
Jump to turn (12)
- 1is that correct config = context.config section = config.configinisection config
- 2from pydantic import BaseSettings, PostgresDsn class Settings(BaseSettings): dbu
- 3alembic revision --autogenerate -m "Database creation" Traceback (most recent ca
- 4still en error
- 5maybe problem in alimbic.ini with that sqlalchemy.url = postgresql+asyncpg://{db
- 6I use from pydantic import BaseSettings, PostgresDsn class Settings(BaseSettings
- 7sqlalchemy.url = postgresql+asyncpg://{DBUSER}:{DBPASS}@{DBHOST}:{DBPORT}/{DBNAM
- 8I added @property def dburl(self): return f"postgresql+asyncpg://{self.dbuser}:{
- 9repeat
- 10sqlalchemy.exc.ArgumentError: Could not parse SQLAlchemy URL from string '${DBUR
- 11raise exc.ArgumentError( sqlalchemy.exc.ArgumentError: Could not parse SQLAlchem
- 12maybe problem is here section = config.configinisection config.setsectionoption(
- User
is that correct config = context.config
section = config.config_ini_section config.set_section_option(section, "DB_HOST", settings.db_host) config.set_section_option(section, "DB_PORT", settings.db_port) config.set_section_option(section, "DB_USER", settings.db_user) config.set_section_option(section, "DB_NAME", settings.db_name) config.set_section_option(section, "DB_PASS", settings.db_pass)
- Assistant
As an AI language model, I cannot assess whether this code is correct or not without understanding the context and dependencies of the code. However, based on the syntax and logic, it seems to be setting the configuration options related to database settings using the information provided in the
settingsobject. - User