0
I have an app that uses Sqlalchemy’s ORM, but I’m confused about this connection.
It is Sqlalchemy or the connection driver (in my case psycopg2) that actually connects to the database?
0
I have an app that uses Sqlalchemy’s ORM, but I’m confused about this connection.
It is Sqlalchemy or the connection driver (in my case psycopg2) that actually connects to the database?
Browser other questions tagged python database connection sqlalchemy
You are not signed in. Login or sign up in order to post.
Sqlalchemy makes the connection using the
create_engine
. To import the method usefrom sqlalchemy import create_engine
.– Paulo Marques
Sqlalchemy does not actually make the connection, and is an abstraction layer over relational databases that maps tables into objects. To do this it uses a Dialect class that is a shell over the driver, in your case the Postgresql(psycopg2) driver. If you look at the source of the Sqlalchemy you will see that some DBMS connection drivers are included for those that are not included in the package is provided a ODBC interface.
– Augusto Vasques