1

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 just 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.

1 Answer 1

5

Pipe it to the dbshell command like so:

python manage.py sqlindexes my_app | python manage.py dbshell
Sign up to request clarification or add additional context in comments.

3 Comments

Thanks, I knew I was missing something!
@sdolan I couldn't find this in the django-admin official documentation. Did you find this somewhere documented? Where?
@SantiagoAgüero: I'm not sure if it's documented anywhere. It's just using unix principles to pipe output into a script.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.