-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathtest.js
93 lines (70 loc) · 3.44 KB
/
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
var jsonDB = require('./index.js');
/*jsonDB.createDatabase({'name': 'test'}, function(response) {
console.log(JSON.stringify(response));
});*/
/*jsonDB.dropDatabase('test', function(response) {
console.log(JSON.stringify(response));
});*/
/*jsonDB.createTable({'database': 'test', 'tableName': 'users'}, function(response) {
console.log(JSON.stringify(response));
});*/
/*jsonDB.createTable({'database': 'test', 'tableName': 'users21'}, function(response) {
console.log(JSON.stringify(response));
});*/
/*jsonDB.createTable({'database': 'test', 'tableName': 'tokens'}, function(response) {
console.log(JSON.stringify(response));
});*/
/*jsonDB.dropTable({'database': 'test', 'tableName': 'users3'}, function(response) {
console.log(JSON.stringify(response));
});*/
/*jsonDB.dropTable({'database': 'test', 'tableName': 'users21'}, function(response) {
console.log(JSON.stringify(response));
});*/
/*jsonDB.insertRecord({'database': 'test', 'tableName': 'users', record: {'email': 'abc121'}}, function(response) {
console.log(JSON.stringify(response));
});*/
/*jsonDB.getRecordById({'database': 'test', 'tableName': 'users', recordId: '1'}, function(response) {
console.log(JSON.stringify(response));
});*/
/*jsonDB.getRecordByKeyValue({'database': 'test', 'tableName': 'users', key: 'email', value: 'abc'}, function(response) {
console.log(JSON.stringify(response));
});*/
/*jsonDB.getRecordByObject({'database': 'test', 'tableName': 'users', obj: {'email': 'abc', 'password': 'passpass'}}, function(response) {
console.log(JSON.stringify(response));
});*/
/*jsonDB.getAllRecords({'database': 'test', 'tableName': 'users'}, function(response) {
console.log(JSON.stringify(response));
});*/
/*jsonDB.deleteRecordById({'database': 'test', 'tableName': 'users', 'recordId': '1'}, function(response) {
console.log(JSON.stringify(response));
});*/
/*jsonDB.deleteRecordByKeyValue({'database': 'test', 'tableName': 'users', key: 'email', value: 'ab2c'}, function(response) {
console.log(JSON.stringify(response));
});*/
/*jsonDB.updateRecordById({'database': 'test', 'tableName': 'users', recordId: '10', recordObj: {'email': 'new123', 'pwd': 'password'}}, function(response) {
console.log(JSON.stringify(response));
});*/
/*for (i=0; i<100; i++) {
jsonDB.getRecordById({'database': 'test', 'tableName': 'users', recordId: '116'}, function(response) {
console.log(JSON.stringify(response));
});
}*/
/*jsonDB.asyncTest({'database': 'test', 'tableName': 'users', recordObj: {'email': 'new123', 'pwd': 'password'}}, function(response) {
console.log('111111111111111111111111111111');
console.log(JSON.stringify(response));
});
jsonDB.asyncTest({'database': 'test', 'tableName': 'users', recordObj: {'email': 'new123', 'pwd': 'password'}}, function(response) {
console.log('2222222222222222222222222222');
console.log(JSON.stringify(response));
});*/
/*jsonDB.updateRecordByKeyValue({'database': 'test', 'tableName': 'users', key: 'email', value: 'ab14',recordObj: {'email': 'ab14', 'pwd': '1234'}}, function(response) {
console.log(JSON.stringify(response));
});*/
/*jsonDB.getRecordsBySearch({'database': 'test', 'tableName': 'users', key: 'email', value: '123', 'flag': 'endsWith'}, function(response) {
console.log(JSON.stringify(response));
});*/
/*for (i=0;i<1000;i++) {
jsonDB.batchInsert({'database': 'test', 'tableName': 'users', records: [{'email': 'a'+ i},{'email': 'b' + i},{'email': 'c'+ i}]}, function(response) {
console.log(JSON.stringify(response));
});
}*/