开发者

How to use django's manage.py sql* commands with mysql

开发者 https://www.devze.com 2023-02-05 00:45 出处:网络
How are the sql* commands meant to be used? They just output sql, so is there an elegant way to pass it to mysql? ./manage.py sqlindexes [app] gives me the mysql code - do I j开发者_如何转开发ust note

How are the sql* commands meant to be used? They just output sql, so is there an elegant way to pass it to mysql? ./manage.py sqlindexes [app] gives me the mysql code - do I j开发者_如何转开发ust note it down and then type it in? (edit: erm...copy and paste for others. heh.)

Pardon my ignorance, and please let me know if there's a completely different but better way of using it.


Pipe it to the dbshell command like so:

python manage.py sqlindexes my_app | python manage.py dbshell
0

精彩评论

暂无评论...
验证码 换一张
取 消