Skip to content

Commit

Permalink
crsqlite seems unstable
Browse files Browse the repository at this point in the history
  • Loading branch information
ospfranco committed Dec 22, 2024
1 parent 162dbfc commit 720693f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 14 deletions.
3 changes: 1 addition & 2 deletions cpp/bridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,8 @@ sqlite3 *opsqlite_open(std::string const &name, std::string const &path,
}

void opsqlite_close(sqlite3 *db) {

#ifdef OP_SQLITE_USE_CRSQLITE
opsqlite_execute(name, "select crsql_finalize();", nullptr);
opsqlite_execute(db, "select crsql_finalize();", nullptr);
#endif

sqlite3_close_v2(db);
Expand Down
14 changes: 7 additions & 7 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@
"node": ">=18"
},
"op-sqlite": {
"sqliteFlags": "-DSQLITE_TEMP_STORE=2",
"sqlcipher": false,
"libsql": false,
"performanceMode": true,
"iosSqlite": true,
"crsqlite": false,
"sqlcipher": false,
"iosSqlite": false,
"fts5": true,
"rtree": false,
"sqliteVec": false,
"rtree": true,
"crsqlite": false,
"sqliteVec": true,
"sqliteFlags": "-DSQLITE_TEMP_STORE=2",
"performanceMode": true,
"tokenizers": [
"wordtokenizer",
"porter"
Expand Down
5 changes: 2 additions & 3 deletions example/src/tests/dbsetup.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,18 +86,18 @@ export function dbSetupTests() {
});
}

it('Should load extension on runtime', async () => {
it('Should load extension', async () => {
let db = open({
name: 'extensionDb',
encryptionKey: 'test',
});

try {
db.loadExtension('path');
} catch (e) {
// TODO load a sample extension
expect(e).to.exist;
} finally {
db.close();
db.delete();
}
});
Expand All @@ -108,7 +108,6 @@ export function dbSetupTests() {
encryptionKey: 'test',
});

db.close();
db.delete();
});

Expand Down
3 changes: 1 addition & 2 deletions scripts/turnOffEverything.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ const packageJson = JSON.parse(fs.readFileSync('./example/package.json'));
// Modify the op-sqlite.sqlcipher key to true
packageJson['op-sqlite']['libsql'] = false;
packageJson['op-sqlite']['sqlcipher'] = false;
packageJson['op-sqlite']['crsqlite'] = false;
packageJson['op-sqlite']['iosSqlite'] = false;
packageJson['op-sqlite']['fts5'] = true;
packageJson['op-sqlite']['rtree'] = true;
packageJson['op-sqlite']['crsqlite'] = true;
packageJson['op-sqlite']['crsqlite'] = false;
packageJson['op-sqlite']['sqliteVec'] = true;

// Save the updated package.json file
Expand Down

0 comments on commit 720693f

Please sign in to comment.