繁体   English   中英

如何使用peewee orm从模式内的特定表创建模型? (FastAPI 项目)

[英]How to create a model from a specific table that is inside a schema using peewee orm? (FastAPI Project)

我需要使用 orm peewee 从我的数据库中的模式内的表创建一个模型,我找到了一个命令,该命令允许我在 postgresql 中从我的数据库生成所有模型

python -m pwiz -e postgresql db_name > db_name_models.py

但我只需要创建特定表的模型,该模型位于架构内。

您可以使用提供的命令行选项http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#pwiz

使用-t选项提及表

python -m pwiz -e postgresql db_name  -t tablename, tablname2 > db_name_models.py

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM