88/*!
99 * DB2 connector for LoopBack
1010 */
11- var IBMDB = require ( 'loopback-ibmdb' ) . IBMDB ;
12- var util = require ( 'util' ) ;
13- var debug = require ( 'debug' ) ( 'loopback:connector:db2' ) ;
11+ const IBMDB = require ( 'loopback-ibmdb' ) . IBMDB ;
12+ const util = require ( 'util' ) ;
13+ const debug = require ( 'debug' ) ( 'loopback:connector:db2' ) ;
1414
1515/**
1616 * Initialize the IBMDB connector for the given data source
@@ -48,10 +48,10 @@ util.inherits(DB2, IBMDB);
4848DB2 . prototype . create = function ( model , data , options , callback ) {
4949 debug ( 'DB2.prototype.create: model=%s, data=%j, options=%j' ,
5050 model , data , options ) ;
51- var self = this ;
52- var stmt = self . buildInsert ( model , data , options ) ;
53- var idName = self . idColumn ( model ) ;
54- var sql ;
51+ const self = this ;
52+ const stmt = self . buildInsert ( model , data , options ) ;
53+ const idName = self . idColumn ( model ) ;
54+ let sql ;
5555
5656 if ( ! data [ idName ] ) {
5757 sql = 'SELECT \"' + idName + '\" FROM FINAL TABLE (' +
@@ -84,15 +84,15 @@ DB2.prototype.create = function(model, data, options, callback) {
8484DB2 . prototype . update = function ( model , where , data , options , cb ) {
8585 debug ( 'DB2.prototype.update: model=%s, where=%j, data=%j options=%j' ,
8686 model , where , data , options ) ;
87- var self = this ;
88- var stmt = self . buildUpdate ( model , where , data , options ) ;
89- var idName = self . idColumn ( model ) ;
90- var sql = 'SELECT COUNT(\"' + idName + '\") AS \"affectedRows\" ' +
87+ const self = this ;
88+ const stmt = self . buildUpdate ( model , where , data , options ) ;
89+ const idName = self . idColumn ( model ) ;
90+ const sql = 'SELECT COUNT(\"' + idName + '\") AS \"affectedRows\" ' +
9191 'FROM FINAL TABLE (' + stmt . sql + ')' ;
9292 self . execute ( sql , stmt . params , options , function ( err , info ) {
9393 if ( cb ) {
9494 if ( ! err && info && info . length > 0 ) {
95- var count = Number . parseInt ( info [ 0 ] . affectedRows , 10 ) ;
95+ const count = Number . parseInt ( info [ 0 ] . affectedRows , 10 ) ;
9696 return cb ( null , { count : count } ) ;
9797 }
9898 cb ( err ) ;
@@ -111,15 +111,15 @@ DB2.prototype.update = function(model, where, data, options, cb) {
111111DB2 . prototype . destroyAll = function ( model , where , options , cb ) {
112112 debug ( 'DB2.prototype.destroyAll: model=%s, where=%j, options=%j' ,
113113 model , where , options ) ;
114- var self = this ;
115- var stmt = self . buildDelete ( model , where , options ) ;
116- var idName = self . idColumn ( model ) ;
117- var sql = 'SELECT COUNT(\"' + idName + '\") AS \"affectedRows\" ' +
114+ const self = this ;
115+ const stmt = self . buildDelete ( model , where , options ) ;
116+ const idName = self . idColumn ( model ) ;
117+ const sql = 'SELECT COUNT(\"' + idName + '\") AS \"affectedRows\" ' +
118118 'FROM OLD TABLE (' + stmt . sql + ')' ;
119119 self . execute ( sql , stmt . params , options , function ( err , info ) {
120120 if ( cb ) {
121121 if ( ! err && info && info . length > 0 ) {
122- var count = Number . parseInt ( info [ 0 ] . affectedRows , 10 ) ;
122+ const count = Number . parseInt ( info [ 0 ] . affectedRows , 10 ) ;
123123 return cb ( null , { count : count } ) ;
124124 }
125125 cb ( err ) ;
0 commit comments