def __init__(self, conn_dict, profile=None, echo=False):
    'Inititate connection'
    self._cred = struct(conn_dict)
    self._cred.kwargs = conn_dict.get('kwargs', {})
    self.name = self._cred.get('name', None)
    self.username = self._cred.get('username', None)
    self.type = self._cred.type
    self.engine = None
    self._cursor_description = None
    self.profile = profile
    self.batch_size = 10000
    self.fetch_size = 20000
    self.echo = echo
    self.connect()
    self.last_connect = now()
    template_base_path = '{}/database/templates/base.yaml'.format(get_dir_path())
    self.template_dict = read_yaml(template_base_path)
    template_path = '{}/database/templates/{}.yaml'.format(get_dir_path(), self.type)
    temp_dict = read_yaml(template_path)
    for key1 in temp_dict:
        if isinstance(temp_dict[key1], dict):
            if (key1 not in self.template_dict):
                self.template_dict[key1] = temp_dict[key1]
            for key2 in temp_dict[key1]:
                self.template_dict[key1][key2] = temp_dict[key1][key2]
        else:
            self.template_dict[key1] = temp_dict[key1]
    self.variables = self._template('variables')
    if os.getenv('PROFILE_YAML'):
        other_vars = get_variables()
        for key in other_vars:
            self.variables[key] = other_vars[key]
    self.tmp_folder = self.variables['tmp_folder']
    self.set_variables()
    if echo:
        log('Connected to {} as {}'.format(self._cred.name, self._cred.user))
Inititate connection
def __init__(self, conn_dict, profile=None, echo=False):
    
    self._cred = struct(conn_dict)
    self._cred.kwargs = conn_dict.get('kwargs', {})
    self.name = self._cred.get('name', None)
    self.username = self._cred.get('username', None)
    self.type = self._cred.type
    self.engine = None
    self._cursor_description = None
    self.profile = profile
    self.batch_size = 10000
    self.fetch_size = 20000
    self.echo = echo
    self.connect()
    self.last_connect = now()
    template_base_path = '{}/database/templates/base.yaml'.format(get_dir_path())
    self.template_dict = read_yaml(template_base_path)
    template_path = '{}/database/templates/{}.yaml'.format(get_dir_path(), self.type)
    temp_dict = read_yaml(template_path)
    for key1 in temp_dict:
        if isinstance(temp_dict[key1], dict):
            if (key1 not in self.template_dict):
                self.template_dict[key1] = temp_dict[key1]
            for key2 in temp_dict[key1]:
                self.template_dict[key1][key2] = temp_dict[key1][key2]
        else:
            self.template_dict[key1] = temp_dict[key1]
    self.variables = self._template('variables')
    if os.getenv('PROFILE_YAML'):
        other_vars = get_variables()
        for key in other_vars:
            self.variables[key] = other_vars[key]
    self.tmp_folder = self.variables['tmp_folder']
    self.set_variables()
    if echo:
        log('Connected to {} as {}'.format(self._cred.name, self._cred.user))