Database interaction layer for sqlite3 in python