The project I'm currently working on is mostly pythonic, by this reason I'll likely use mysqldb python connector or sqlalchemy.

The question arose when I've tried to find out the way of adding new stored procedure to my database via those connectors. I've found a dozens of examples of how to call an existing stored procedures from a database but none of how to actually add (create) a new one by them.

I kept on googling and have found text() construct in sqlalchemy, this one enables me to write raw sql code, so IMO, can be used for adding a new stored procedure to the existing db.

Generally speaking there always is a direct way to do so by using mysql shell or workbench editor. But how can this task be achieved with mysqldb python connector(if at all)?

Is it a good/weird practice to add new stored procedure that way?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.