public function connect() {
		if (!$this->connected) {
			if ($this->config['host']{0} == '/') {
				$connector = $this->config['driver'].':unix_socket='.$this->config['host'].';dbname='.$this->config['db'];
			} else {
				$connector = $this->config['driver'].':host='.$this->config['host'].';dbname='.$this->config['db'];
			}
			
			// sqlite
			if ($this->config['driver'] == 'sqlite') {
				$connector = $this->config['driver'].':'.$this->config['file'].'';
			}
			
			parent::__construct($connector, $this->config['user'], $this->config['pass']);

			$this -> setAttribute(\PDO::ATTR_CASE, \PDO::CASE_NATURAL); // leave column names as returned by the database driver
			$this -> setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); // on errors we want to get \Exceptions

			// set encoding
			if (isset($this->config['encoding']) && $this->config['driver'] != 'sqlite') {
				parent::exec('SET NAMES '.$this->config['encoding']);
			}

			$this->connected = true;
		}
	}