27 lines
629 B
Python
27 lines
629 B
Python
import click
|
|
|
|
from .database import create as db_create, pwreset as db_pwreset, delete as db_delete
|
|
|
|
|
|
@click.group(short_help='Perform operations on MySQL')
|
|
def mysql():
|
|
pass
|
|
|
|
|
|
@mysql.command(short_help='Create a MySQL database for a user')
|
|
@click.argument('username')
|
|
def create(username):
|
|
db_create(username, 'mysql')
|
|
|
|
|
|
@mysql.command(short_help='Reset the password of a MySQL user')
|
|
@click.argument('username')
|
|
def pwreset(username):
|
|
db_pwreset(username, 'mysql')
|
|
|
|
|
|
@mysql.command(short_help="Delete the database of a MySQL user")
|
|
@click.argument('username')
|
|
def delete(username):
|
|
db_delete(username, 'mysql')
|