如何使用 SQLAlchemy 创建 SQLite 数据库
以下代码将使用 sqlalchemy 在当前目录中创建 my-sqlite.db:
how-to-create-sqlite-database-using-sqlalchemy.py
import sqlalchemy
db = sqlalchemy.create_engine('sqlite:///my-sqlite.db')注意你需要在 sqlite:/// 中使用三个斜杠以使用数据库的相对路径。如果你想要绝对路径,使用四个斜杠:sqlite:////。
Check out similar posts by category:
Python
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow