Skip to content

Commit

Permalink
[BUGFIX][CLEANUP]
Browse files Browse the repository at this point in the history
Set default datastore config on constructor
  • Loading branch information
Daniel Sumardi committed Sep 6, 2019
1 parent 878f35d commit 56e21ac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class QueryBuilder {
constructor(config) {
let { datastore } = config;
let { datastore } = config ? config : { datastore: 'postgresql' } ;

this.selectField = [];
this.fromField = [];
Expand Down Expand Up @@ -143,7 +143,7 @@ class QueryBuilder {
}

if (this.limit && this.offset) {
if (this.datastore === 'postgresql' || !this.datastore) {
if (this.datastore === 'postgresql') {
queryString += `LIMIT ${this.limit} `;
queryString += `OFFSET ${this.offset} `;
}
Expand Down

0 comments on commit 56e21ac

Please sign in to comment.