Opening SQLite database to write