lib/adapters/mysql.js
function () {
            var ret = "";
            var updateCols = this.__opts.onDuplicateKeyUpdate;
            if (updateCols) {
                var updateVals = null, l, last;
                if ((l = updateCols.length) > 0 && isHash((last = updateCols[l - 1]))) {
                    updateVals = last;
                    updateCols = l === 2 ? [updateCols[0]] : updateCols.slice(0, l - 2);
                }
                var updating = updateCols.map(function (c) {
                    var quoted = this.quoteIdentifier(c);
                    return format("%s=VALUES(%s)", quoted, quoted);
                }, this);
                for (var i in updateVals) {
                    if (i in updateVals) {
                        updating.push(format("%s=%s", this.quoteIdentifier(i), this.literal(updateVals[i])));
                    }
                }
                if (updating || updateVals) {
                    ret =
                        format(" ON DUPLICATE KEY UPDATE %s", updating.join(this._static.COMMA_SEPARATOR));
                }
            }
            return ret;
        }
function () {
            var ret = "";
            var updateCols = this.__opts.onDuplicateKeyUpdate;
            if (updateCols) {
                var updateVals = null, l, last;
                if ((l = updateCols.length) > 0 && isHash((last = updateCols[l - 1]))) {
                    updateVals = last;
                    updateCols = l === 2 ? [updateCols[0]] : updateCols.slice(0, l - 2);
                }
                var updating = updateCols.map(function (c) {
                    var quoted = this.quoteIdentifier(c);
                    return format("%s=VALUES(%s)", quoted, quoted);
                }, this);
                for (var i in updateVals) {
                    if (i in updateVals) {
                        updating.push(format("%s=%s", this.quoteIdentifier(i), this.literal(updateVals[i])));
                    }
                }
                if (updating || updateVals) {
                    ret =
                        format(" ON DUPLICATE KEY UPDATE %s", updating.join(this._static.COMMA_SEPARATOR));
                }
            }
            return ret;
        }
function ( ) { var ret = "" ; var updateCols = this . __opts . onDuplicateKeyUpdate ; if ( updateCols ) { var updateVals = null , l , last ; if ( ( l = updateCols . length ) > 0 && isHash ( ( last = updateCols [ l - 1 ] ) ) ) { updateVals = last ; updateCols = l === 2 ? [ updateCols [ 0 ] ] : updateCols . slice ( 0 , l - 2 ) ; } var updating = updateCols . map ( function ( c ) { var quoted = this . quoteIdentifier ( c ) ; return format ( "%s=VALUES(%s)" , quoted , quoted ) ; } , this ) ; for ( var i in updateVals ) { if ( i in updateVals ) { updating . push ( format ( "%s=%s" , this . quoteIdentifier ( i ) , this . literal ( updateVals [ i ] ) ) ) ; } } if ( updating || updateVals ) { ret = format ( " ON DUPLICATE KEY UPDATE %s" , updating . join ( this . _static . COMMA_SEPARATOR ) ) ; } } return ret ; }
MySQL specific syntax for ON DUPLICATE KEY UPDATE
MySQL specific syntax for ON DUPLICATE KEY UPDATE