Search code examples
sqlitegoogle-chromegoogle-gears

Google Gears - Database - VACUUM


With this code:

var db = google.gears.factory.create('beta.database');
db.open('cominar');
db.execute('CREATE TABLE IF NOT EXISTS Ajax (AJAX_ID INTEGER PRIMARY KEY AUTOINCREMENT , MODULE TEXT, FUNCTION TEXT, CONTENT_JSON TEXT);');
db.execute('VACUUM;'); // nettoye la DB

I'm trying to clean the database (VACUUM) at each initialisation but I get this error:

Uncaught Error: Database operation failed. ERROR: authorization denied DETAILS: not authorized

The database was created by me (the same page).

Thank you!


Solution

  • I think that this is not allowed operation, so Gears team did not allow users to use this feature of Sqlite. Not all operations are allowed from JavaScript. For example attaching database could be dangerous so it is not allowed.