File tree Expand file tree Collapse file tree 4 files changed +5
-5
lines changed
Expand file tree Collapse file tree 4 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 1212# Ensure it uses asyncpg
1313if raw_url .startswith ("postgresql://" ):
1414 raw_url = raw_url .replace ("postgresql://" , "postgresql+asyncpg://" , 1 )
15- elif not raw_url . startswith ( "postgresql+asyncpg://" ) :
15+ else :
1616 raise ValueError (
1717 "Invalid DATABASE_URL: must start with postgresql:// or postgresql+asyncpg://"
1818 )
19-
19+
2020DATABASE_URL = raw_url
2121
2222engine = create_async_engine (DATABASE_URL , echo = True )
Original file line number Diff line number Diff line change 1212# Ensure it uses asyncpg
1313if raw_url .startswith ("postgresql://" ):
1414 raw_url = raw_url .replace ("postgresql://" , "postgresql+asyncpg://" , 1 )
15- elif not raw_url . startswith ( "postgresql+asyncpg://" ) :
15+ else :
1616 raise ValueError (
1717 "Invalid DATABASE_URL: must start with postgresql:// or postgresql+asyncpg://"
1818 )
Original file line number Diff line number Diff line change 1414# Ensure the URL uses asyncmy driver
1515if raw_url .startswith ("mysql://" ):
1616 raw_url = raw_url .replace ("mysql://" , "mysql+asyncmy://" , 1 )
17- elif not raw_url . startswith ( "mysql+asyncmy://" ) :
17+ else :
1818 raise ValueError (
1919 "Invalid DATABASE_URL: must start with mysql:// or mysql+asyncmy://"
2020 )
Original file line number Diff line number Diff line change 1515# Ensure the URL uses asyncmy driver
1616if raw_url .startswith ("mysql://" ):
1717 raw_url = raw_url .replace ("mysql://" , "mysql+asyncmy://" , 1 )
18- elif not raw_url . startswith ( "mysql+asyncmy://" ) :
18+ else :
1919 raise ValueError (
2020 "Invalid DATABASE_URL: must start with mysql:// or mysql+asyncmy://"
2121 )
You can’t perform that action at this time.
0 commit comments