sqlbag icon indicating copy to clipboard operation
sqlbag copied to clipboard

SQLAlchemy 1.4.0 makes URL object immutable

Open actuchicks opened this issue 4 years ago • 0 comments

:wave: Looks like this change in SQLAlchemy 1.4.0 is a problem: https://docs.sqlalchemy.org/en/14/changelog/migration_14.html#the-url-object-is-now-immutable

    @contextmanager
    def admin_db_connection(db_url):
        url = copy_url(db_url)
        dbtype = url.get_dialect().name
    
        if dbtype == "postgresql":
>           url.database = ""
E           AttributeError: can't set attribute

.venv/lib/python3.8/site-packages/sqlbag/sqla.py:214: AttributeError

actuchicks avatar Mar 17 '21 05:03 actuchicks