Last active
September 5, 2023 10:59
-
-
Save mansha99/44f3fdc0ae37a1b282472f5fa15ff58b to your computer and use it in GitHub Desktop.
Initializing SQLAchemy Session
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sqlalchemy import create_engine | |
from sqlalchemy.orm import Session | |
import pymysql | |
pymysql.install_as_MySQLdb() #MySQL specific | |
connectionString="mysql+mysqldb://root:India12#$@localhost/alchemydb2" | |
engine = create_engine(connectionString,echo=False)#echo True will print on screen | |
session = Session(engine) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment