def database_info(connection):
    """
    Parse an SQL string of the format:
        database_type://user:password@address:/database
        mysql://dbadmin:password@10.0.0.1/nova
    """
    db = {}
    conn = connection.partition(':')
    if conn[1] != ':':
        return None
    db['type'] = conn[0]
    conn = conn[2]
    conn = conn.lstrip('/')
    conn = conn.partition(':')
    if conn[1] != ':':
        return None
    db['user'] = conn[0]
    conn = conn[2]
    conn = conn.partition('@')
    if conn[1] != '@':
        return None
    db['password'] = conn[0]
    conn = conn[2]
    conn = conn.partition('/')
    if conn[1] != '/':
        return None
    db['address'] = conn[0]
    db['database'] = conn[2]
    return db