initial commit
This commit is contained in:
commit
faae9db46a
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
/node_modules
|
||||
*.db3
|
16
index.js
Normal file
16
index.js
Normal file
@ -0,0 +1,16 @@
|
||||
var s = require('sqlite3');
|
||||
var db = new s.Database('osm.db3');
|
||||
|
||||
db.serialize(function() {
|
||||
db.run("CREATE TABLE IF NOT EXISTS sales(cust text, part text, value numeric)");
|
||||
});
|
||||
|
||||
db.serialize(function() {
|
||||
db.run("INSERT INTO sales VALUES ('Agri AFC','nsr001g',.50)");
|
||||
});
|
||||
|
||||
db.each("SELECT cust, part FROM sales", function(err, row) {
|
||||
console.log(row.cust + ": " + row.part);
|
||||
});
|
||||
|
||||
db.close;
|
1213
package-lock.json
generated
Normal file
1213
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
15
package.json
Normal file
15
package.json
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"name": "sqlite_test",
|
||||
"version": "1.0.0",
|
||||
"description": "test",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"express": "^4.17.1",
|
||||
"sqlite3": "^4.1.1"
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user