Windows中的SQLAlchemy引擎绝对路径URL
发布于 2021-01-29 15:15:30
我正在尝试在Windows 7 x64计算机上连接到python 3.3应用程序中的sqlite数据库文件。为此,文档指出:
# sqlite://<nohostname>/<path>
# where <path> is relative:
engine = create_engine('sqlite:///foo.db')
# or absolute, starting with a slash:
engine = create_engine('sqlite:////absolute/path/to/foo.db')
我想使用绝对路径,Windows等效于sqlite:////absolute/path/to/foo.db
什么?该数据库存储在中C:/Users/Username/AppData/Roaming/Appname/mydatabase.db
。
任何帮助表示赞赏!
关注者
0
被浏览
51
1 个回答