generalization of sqlite3 connection