-
Notifications
You must be signed in to change notification settings - Fork 9
/
test.js
32 lines (30 loc) · 678 Bytes
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
var sys = require('sys');
var Step = require('step');
require('proto');
var DbDriver = require('persistence/plain');
Step(
function connect() {
sys.puts("connect");
DbDriver.connect('mydb.json', this);
},
function getStore(err, db) {
if (err) { throw err; }
sys.puts("getStore", sys.inspect(db));
this.db = db;
db.getStore("people", this);
},
function testStore(err, people) {
if (err) { throw err; }
people.get();
people.update();
people.insert();
people.remove();
sys.puts("testStore");
sys.p(people);
this.db.close(this);
},
function done(err) {
if (err) { throw err; }
sys.puts("done");
}
);