Updated SQLite code