You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
684 B
26 lines
684 B
import click
|
|
|
|
from .database import create as db_create, pwreset as db_pwreset, delete as db_delete
|
|
|
|
|
|
@click.group(short_help='Perform operations on PostgreSQL')
|
|
def postgresql():
|
|
pass
|
|
|
|
|
|
@postgresql.command(short_help='Create a PostgreSQL database for a user')
|
|
@click.argument('username')
|
|
def create(username):
|
|
db_create(username, 'postgresql')
|
|
|
|
|
|
@postgresql.command(short_help='Reset the password of a PostgreSQL user')
|
|
@click.argument('username')
|
|
def pwreset(username):
|
|
db_pwreset(username, 'postgresql')
|
|
|
|
|
|
@postgresql.command(short_help="Delete the database of a PostgreSQL user")
|
|
@click.argument('username')
|
|
def delete(username):
|
|
db_delete(username, 'postgresql')
|
|
|