INNER CODE UNIT · Python

save

evangelosmeklis/peepdb · peepdb/cli.py:65

def save(connection_name, db_type, host, port, user, password, database, trusted):
    """
    Save a new database connection.

    Example:
    peepdb save test_conn --db-type mssql --host localhost --port 1433 --trusted --database SomeDB
    """
    if trusted:
        # For Windows Authentication, we skip user/password
        user = ''
        password = ''
    elif db_type not in ['sqlite', 'firebase']:
        if not user:
            user = click.prompt('Enter username')
        if not password:
            password = click.prompt('Enter password', hide_input=True, confirmation_prompt=True)

    save_connection(connection_name, db_type, host, port, user, password, database, trusted)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…