You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constfs=require('fs');varsqlite=require('sqlite-cipher');functionsimulateWorkflow(databaseFilePath,databasePassword,fcbOnCompletion){varbFileExist=false;if(fs.existsSync(databaseFilePath)){bFileExist=true;console.log(databaseFilePath+" exist");}varc;c=sqlite.connect(databaseFilePath,databasePassword,'aes-256-ctr');if(bFileExist==false){console.log(databaseFilePath+" is a new database");try{varcreateData=c.run("CREATE TABLE `_internal` ( `id` INTEGER PRIMARY KEY AUTOINCREMENT, `client_name` TEXT UNIQUE ); ");console.log("Creation : "+JSON.stringify(createData));if(createData.error){return;}varinsertData=c.run("INSERT INTO `_internal` (`client_name`) VALUES (\'"+databaseFilePath+"\'); ");console.log("Insertion : "+JSON.stringify(insertData));if(insertData.error){return;}varrows=c.run("SELECT * FROM `_internal`");console.log("DB("+databaseFilePath+") query result => "+JSON.stringify(rows));c.close();c=null;}catch(e1){console.log("SQL Exception : "+e1);c.close();c=null;}}else{// Query contents of _internal table in case DB file is presenttry{varrows=c.run("SELECT * FROM `_internal`");console.log("DB("+databaseFilePath+") query result => "+JSON.stringify(rows));c.close();c=null;}catch(e1){console.log("SQL Exception : "+e1);c.close();c=null;}}}//// Precondition: x1.db (password: 'pass') is already present with '_internal' db and one entry (client_name = x1)//simulateWorkflow('x1.db','pass');simulateWorkflow('x2.db','4_jS3XEW{D#E##(@!JD');
DB(x2.db) query result => [{"id":1,"client_name":"x2.db"}]
The text was updated successfully, but these errors were encountered:
HydroCarbons
changed the title
Successive SQL operations (querying and creating, inserting & querying) two encrypted databases are resulting in weird behavior
Successive SQL operations on two encrypted databases are resulting in weird behavior
Feb 27, 2018
Successive SQL operations (querying and creating, inserting & querying) two encrypted databases are resulting in weird behavior
PACKAGE.JSON
CODE (multi-db-issue.js)
OUTPUT
[First execution]
[Expected]
[Second execution]
[Expected]
The text was updated successfully, but these errors were encountered: