r/FastAPI • u/[deleted] • Jan 21 '22
Question Microsoft SQL Server
Will Microsoft SQL Server ever be integrated into fastapi?
0
Upvotes
1
4
u/Enrique-M Jan 21 '22
As u/Vok250 mentioned, you can use pymssql for SQL Server connectivity. Also, you can use PyODBC after installing the appropriate ODBC driver for your SQL Server version and O/S specifics. After that, the main ORM supported in Python for SQL Server is SQLAlchemy.
1
u/Ivana_Twinkle Jan 21 '22
Microsoft hasn't released a odbc driver compatible with Debian 11 yet.
Debian 11 is used in the python docker image and therefore also the fastapi docker image.
It's a pain.
1
12
u/Vok250 Jan 21 '22
You can use any database with FastAPI. It's just a web framework. You don't have to use the same ORMs shown in the tutorials.
Direct quote from the docs here: https://fastapi.tiangolo.com/tutorial/sql-databases/
Just use something like this: https://pypi.org/project/pymssql/