Hi,
I'm working through the Alembic tutorial and I have reached the point where I need to enter the DB URL (sqlalchemy.url).
The URL below (with the DSN py_test) works and I am able to run my migration, but I would like to connect without the DSN.
sqlalchemy.url = mssql+pyodbc://py_test; Trusted_Connection=Yes
I am able to connect to the DB with SQL Alchemy using the URL in the line below:
sqlalchemy.url = mssql+pyodbc:///?odbc_connect=DRIVER={SQL Server};Server=Server;Database=DB;Trusted_Connection=Yes
However, it generates the following error.
sqlalchemy.exc.DBAPIError: (Error) ('08001', '[08001] [Microsoft][ODBC SQL Server Driver]Neither DSN nor SERVER keyword supplied (0) (SQLDriverConnect)') None None
I think the URL is ncoded in SQL Alchmey, and I have tried the line below as well:
sqlalchemy.url = mssql+pyodbc:///?odbc_connect=DRIVER%3D%7BSQL+Server%7D%3BServer%3DServer%3BDatabase%3DDB%3BTrusted_Connection%3DYes
Which generates the error below:
"'%%' must be followed by '%%' or '(', found: %r" % (rest,)) ConfigParser.InterpolationSyntaxError: '%' must be followed by '%' or '(', found: '%3D%7BSQL+Server%7D%3BServer%3DServer%3BDatabase%3DDB%3BTrusted_Connection%3DYes;Trusted_Connection=Yes'
If anyone could please help me I would greatly appreciate it.
Thank you in advance :)
~Victor