You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Of course, sqlalchemy is here acting as a layer on top of pyodbc. Sometimes I'd like to write using the pure pyodbc interface, but I have only a connection string in sqlalchemy format. Purely as a convenience, it would be great if pyodbc accepted the alternative format. Something like
cnxn = pyodbc.connect('mssql+pyodbc://scott:tiger@myserver/mydb?driver=ODBC+Driver+18+for+SQL+Server')
# works
cnxn = pyodbc.connect('postgresql+psycopg2://scott:tiger@myserver/mydb')
# Error: this looks like a URI but the URI scheme postgresql+psycopg2 is not handled. Only URI schemes ending in +pyodbc are handled.
I understand that you don't want to get bogged down in handling all the weird options that sqlalchemy might accept in its connection string, nor in elaborately reproducing its behaviour. So this is kind of a best effort basis for the most common, vanilla URIs that use pyodbc.
The text was updated successfully, but these errors were encountered:
I understand that pyodbc uses a connection string looking like
DRIVER={ODBC Driver 18 for SQL Server};SERVER=myserver;DATABASE=mydb;UID=scott;PWD=tiger
But sqlalchemy has popularized its own URI scheme for database connections, something like
mssql+pyodbc://scott:tiger@myserver/mydb?driver=ODBC+Driver+18+for+SQL+Server
Of course, sqlalchemy is here acting as a layer on top of pyodbc. Sometimes I'd like to write using the pure pyodbc interface, but I have only a connection string in sqlalchemy format. Purely as a convenience, it would be great if pyodbc accepted the alternative format. Something like
I understand that you don't want to get bogged down in handling all the weird options that sqlalchemy might accept in its connection string, nor in elaborately reproducing its behaviour. So this is kind of a best effort basis for the most common, vanilla URIs that use pyodbc.
The text was updated successfully, but these errors were encountered: