Get writable database instance not just a readable one

since we call db.delete(); we should need a writable database instance not just a readable one.