Skip to content

Commit d1e8ad5

Browse files
committed
provide changeUser implementation is promise.js
1 parent 5927562 commit d1e8ad5

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

promise.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,24 @@ PromiseConnection.prototype.prepare = function(options) {
180180
});
181181
};
182182

183+
PromiseConnection.prototype.changeUser = function(options) {
184+
var c = this.connection;
185+
const localErr = new Error();
186+
return new this.Promise(function(resolve, reject) {
187+
c.changeUser(options, function(err) {
188+
if (err) {
189+
localErr.message = err.message;
190+
localErr.code = err.code;
191+
localErr.errno = err.errno;
192+
localErr.sqlState = err.sqlState;
193+
reject(localErr);
194+
} else {
195+
resolve();
196+
}
197+
});
198+
});
199+
};
200+
183201
function PromisePreparedStatementInfo(statement, promiseImpl) {
184202
this.statement = statement;
185203
this.Promise = promiseImpl;

0 commit comments

Comments
 (0)