Skip to content

Commit

Permalink
upgrade jsstore version, rm isDbExist
Browse files Browse the repository at this point in the history
  • Loading branch information
ujjwalguptaofficial committed May 19, 2021
1 parent 93df0b9 commit 1c40614
Show file tree
Hide file tree
Showing 8 changed files with 187 additions and 213 deletions.
1 change: 0 additions & 1 deletion build_helper/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ generateParser = function () {
'src/grammar/select_join.pegjs',
'src/grammar/update.pegjs',
'src/grammar/open.pegjs',
'src/grammar/is_db_exist.pegjs',
'src/grammar/common.pegjs',
'src/grammar/constant.pegjs'
]);
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"devDependencies": {
"chai": "^4.2.0",
"fs-extra": "^7.0.1",
"jsstore": "^3.11.0",
"jsstore": "^4.0.4",
"karma": "^4.1.0",
"karma-chai": "^0.1.0",
"karma-chrome-launcher": "^2.2.0",
Expand All @@ -57,6 +57,6 @@
"webpack-merge": "^4.2.1"
},
"peerDependencies": {
"jsstore": ">=3.11.0"
"jsstore": ">=4.0.3"
}
}
2 changes: 1 addition & 1 deletion src/grammar/index.pegjs
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
query = selectQuery/countQuery/insertQuery/updateQuery/removeQuery/createQuery/openQuery/isDbExistQuery ;
query = selectQuery/countQuery/insertQuery/updateQuery/removeQuery/createQuery/openQuery ;

23 changes: 0 additions & 23 deletions src/grammar/is_db_exist.pegjs

This file was deleted.

21 changes: 6 additions & 15 deletions test/cases/create/demo.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,15 @@
describe('create demo database', function () {
it('use isexist and then open/create db', function (done) {
console.log('initiate database');
con.$sql.run('isDbExist Demo').then(function (isExist) {
console.log('db exist :' + isExist);
if (isExist) {
con.$sql.run('openDb Demo').then(function () {
console.log('Database opened');
done();
});
} else {
var query = getDbSchema();
con.$sql.run(query).then(function () {
console.log('Database created');
done();
});
}
var query = getDbSchema();
con.$sql.run(query).then(function (isDbCreated) {
console.log('Database created');
expect(isDbCreated).equal(true);
done();
}).catch(function (err) {
done(err);
});
});
})
});

// con.jsStoreCon_.isDbExist('Demo').then(function (exist) {
Expand Down
Loading

0 comments on commit 1c40614

Please sign in to comment.