-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create function to change password and algorithm
- Loading branch information
1 parent
a1ecb25
commit 7f6b08c
Showing
3 changed files
with
46 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,45 @@ | ||
var sqlite = require('../sqlite.js'); //requiring | ||
|
||
// Change password | ||
sqlite.changePassword('test/Database.rec','myPass'); | ||
// sqlite.change('test/Database.rec','88560848','myPass','aes-256-ctr','camellia-256-cfb1'); | ||
|
||
// To use initialization vector | ||
// sqlite.iv = '13ewr3iJ'; | ||
sqlite.iv = '13ewr3iJ'; | ||
|
||
// //Connecting - (databaseFile, [password], [algorithm]) | ||
// try{ | ||
// sqlite.connect('test/Database.rec','myPass','aes-256-ctr'); | ||
// }catch(x){ | ||
// console.log(x) | ||
// } | ||
//Connecting - (databaseFile, [password], [algorithm]) | ||
try{ | ||
sqlite.connect('test/Database.rec','myPass','camellia-256-cfb1'); | ||
}catch(x){ | ||
console.log(x) | ||
} | ||
|
||
// // Creating Table - you can run any command | ||
// sqlite.run("CREATE TABLE COMPANYS(ID INTEGER PRIMARY KEY AUTOINCREMENT, NAME TEXT NOT NULL);"); | ||
// Creating Table - you can run any command | ||
sqlite.run("CREATE TABLE COMPANYS(ID INTEGER PRIMARY KEY AUTOINCREMENT, NAME TEXT NOT NULL);"); | ||
|
||
// //Inserting - this function can be sync to, look the wiki | ||
// sqlite.insert("COMPANYS",{NAME:"COMPANY"}, function(inserid){ | ||
// console.log(inserid); | ||
// }); | ||
//Inserting - this function can be sync to, look the wiki | ||
sqlite.insert("COMPANYS",{NAME:"COMPANY"}, function(inserid){ | ||
console.log(inserid); | ||
}); | ||
|
||
// //Updating - returns the number of rows modified - can be async too | ||
// var rows_modified = sqlite.update("COMPANYS",{NAME:"TESTING UPDATE"},{ID:1}); | ||
//Updating - returns the number of rows modified - can be async too | ||
var rows_modified = sqlite.update("COMPANYS",{NAME:"TESTING UPDATE"},{ID:1}); | ||
|
||
// //Create your function | ||
// function concat(a,b){ | ||
// return a+b; | ||
// } | ||
//Create your function | ||
function concat(a,b){ | ||
return a+b; | ||
} | ||
|
||
// //Add your function to connection | ||
// sqlite.create_function(concat); | ||
//Add your function to connection | ||
sqlite.create_function(concat); | ||
|
||
// // Use your function in the SQL | ||
// console.log(sqlite.run("SELECT ID , concat(ID, NAME) as concat FROM COMPANYS;")); | ||
// Use your function in the SQL | ||
console.log(sqlite.run("SELECT ID , concat(ID, NAME) as concat FROM COMPANYS;")); | ||
|
||
// //Decrypting database file | ||
// sqlite.decrypt("test/Database.rec","test/decrypted.db", 'myPass'); | ||
//Decrypting database file | ||
sqlite.decrypt("test/Database.rec","test/decrypted.db", 'myPass'); | ||
|
||
// //Encrypting database file | ||
// sqlite.encrypt("test/decrypted.db","test/reencrypted.rec", 'myPass',"bf",{iv: "ads343ef"}); | ||
//Encrypting database file | ||
sqlite.encrypt("test/decrypted.db","test/reencrypted.rec", 'myPass',"bf",{iv: "ads343ef"}); | ||
|
||
// // Closing connection | ||
// sqlite.close(); | ||
// Closing connection | ||
sqlite.close(); |