1/ Fixed the cfg->library typo - thanks!
2/ I was thinking about refactoring of connect() and config saving function, in the end we might not need to store
$cfg->dbhost = $this->dbhost;
$cfg->dbname = $this->dbname;
$cfg->dbuser = $this->dbuser;
$cfg->dbpass = $this->dbpass;
3/ TRUNCATE is optimal there, just override it in sqlite driver