Merge pull request #978 from narfbg/develop-db-sqlite

Improve the SQLite database driver