Add mysql.script()
convenience function
This commit is contained in:
parent
de2318fd43
commit
31acf33465
|
@ -154,6 +154,13 @@ def sql(sql, database=''):
|
||||||
return sudo("mysql --execute='{}' --batch --skip-column-names {}".format(sql, database))
|
return sudo("mysql --execute='{}' --batch --skip-column-names {}".format(sql, database))
|
||||||
|
|
||||||
|
|
||||||
|
def script(path, database=''):
|
||||||
|
"""
|
||||||
|
Execute a SQL script against the given database.
|
||||||
|
"""
|
||||||
|
sudo('mysql {} < {}'.format(database, path))
|
||||||
|
|
||||||
|
|
||||||
def download_db(name, destination=None):
|
def download_db(name, destination=None):
|
||||||
"""
|
"""
|
||||||
Download a database from the "current" server.
|
Download a database from the "current" server.
|
||||||
|
|
Loading…
Reference in a new issue