sqlalchemy,creating an sqlite database if it doesn't exist

前端 未结 4 983
日久生厌
日久生厌 2021-02-01 04:05

I am trying out sqlalchemy and i am using this connection string to connect to my databases

engine = create_engine(\'sqlite:///C:\\\\sqlitedbs\\\\database.db\')
         


        
4条回答
  •  面向向阳花
    2021-02-01 04:29

    Linux stored SQLite3 database

    database will be create in the same folder as the .py file:

    engine = create_engine('sqlite:///school.db', echo=True)
    

    will instantiate the school.db file in the same folder as the .py file.

提交回复
热议问题