src/Db/Db.js
/**
	 * Close this connection to the database
	 * @return {Promise}  Resolves when connection has been closed
	 */
Close this connection to the database
@return {Promise}  Resolves when connection has been closed
Close this connection to the database @return { Promise } Resolves when connection has been closed
end() {
		return new Promise((resolve, reject) => {
			if (this.connection) {
				const idx = Db.instances.indexOf(this);
				if (idx > -1) {
					Db.instances.splice(idx, 1);
				}
				this.connection.end(error => {
					if (this.ssh) {
						this.ssh.end();
					}
					if (error) {
						decorateError(error);
						reject(error);
					} else {
						resolve();
					}
				});
			} else {
				if (this.ssh) {
					this.ssh.end();
				}
				resolve();
			}
		});
	}
end ( ) { return new Promise ( ( resolve , reject ) => { if ( this . connection ) { const idx = Db . instances . indexOf ( this ) ; if ( idx > - 1 ) { Db . instances . splice ( idx , 1 ) ; } this . connection . end ( error => { if ( this . ssh ) { this . ssh . end ( ) ; } if ( error ) { decorateError ( error ) ; reject ( error ) ; } else { resolve ( ) ; } } ) ; } else { if ( this . ssh ) { this . ssh . end ( ) ; } resolve ( ) ; } } ) ; }
Close this connection to the database
 @return {Promise}  Resolves when connection has been closed
Close this connection to the database @return { Promise } Resolves when connection has been closed