Support either sqlite3 or pg databases