From e3ca11c3fbe9713e344951830c4b7e3f1cc03937 Mon Sep 17 00:00:00 2001 From: Saeed Tabrizi Date: Sat, 2 Nov 2019 15:22:47 +0330 Subject: [PATCH] fix: issue #400 fixed . -fix for https://github.com/orientechnologies/orientjs/issues/400 issue . --- lib/db/sequence/index.js | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/lib/db/sequence/index.js b/lib/db/sequence/index.js index 9a71ed23..8703a057 100644 --- a/lib/db/sequence/index.js +++ b/lib/db/sequence/index.js @@ -94,9 +94,8 @@ Sequence.create = function (name, type, start, incerement, cache) { if (incerement) { query += ' CACHE ' + cache; } - - return this - .query(query) + const ex = this.command || this.exec; + return ex(query) .bind(this) .then(function () { return this @@ -149,9 +148,8 @@ Sequence.update = function (name, start, incerement, cache) { if (incerement) { query += ' CACHE ' + cache; } - - return this - .query(query) + const ex = this.command || this.exec; + return ex(query) .bind(this) .then(function () { return this @@ -170,9 +168,8 @@ Sequence.update = function (name, start, incerement, cache) { Sequence.drop = function (name, config) { config = config || {}; var query = 'DROP SEQUENCE ' + name; - - return this - .exec(query) + const ex = this.command || this.exec; + return ex(query) .bind(this) .then(function () { return this @@ -236,4 +233,4 @@ Sequence.cacheData = function (sequences) { } return this; -}; \ No newline at end of file +};