0.3.9 • Published 5 years ago
sqlite-sync v0.3.9
sqlite-sync.js
Node module to sqlite sync and async
node.js package for database connection with SQLite , and execute SQL commands synchronously or asynchronously.
Install
npm install sqlite-sync
Usage
var sqlite = require('sqlite-sync'); //requiring
//Connecting - if the file does not exist it will be created
sqlite.connect('test/test.db');
//Creating table - you can run any command
sqlite.run("CREATE TABLE COMPANYS(ID INTEGER PRIMARY KEY AUTOINCREMENT, NAME TEXT NOT NULL);",function(res){
if(res.error)
throw res.error;
console.log(res);
});
//Inserting - this function can be sync to, look the wiki
sqlite.insert("COMPANYS",{NAME:"My COMPANY"}, function(res){
if(res.error)
throw res.error;
console.log(res);
});
//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 test(a,b){
return a+b;
}
//Add your function to connection
sqlite.create_function(test);
// Use your function in the SQL
console.log(sqlite.run("SELECT ID, test(NAME, ' Inc') as NAME FROM COMPANYS"));
// Closing connection
sqlite.close();
0.3.9
5 years ago
0.3.8
6 years ago
0.3.7
6 years ago
0.3.6
7 years ago
0.3.5
8 years ago
0.3.4
8 years ago
0.3.3
8 years ago
0.3.2
8 years ago
0.3.1
8 years ago
0.3.0
8 years ago
0.2.1
8 years ago
0.2.0
8 years ago
0.1.10
8 years ago
0.1.9
8 years ago
0.1.8
8 years ago
0.1.7
8 years ago
0.1.6
8 years ago
0.1.5
8 years ago
0.1.4
8 years ago
0.1.2
8 years ago
0.1.1
8 years ago
0.1.0
8 years ago