mysql-generator
Advanced tools
Comparing version 1.0.8 to 1.0.9
@@ -23,6 +23,3 @@ const Base = require('./base'); | ||
_join(tableNameOrQuery, tableAlias, onCondition, joinType, ...values) { | ||
values.map(value => { | ||
onCondition = onCondition.replace(/\?/, this.escape(value)); | ||
}); | ||
_join(tableNameOrQuery, tableAlias, onCondition, joinType) { | ||
if (tableNameOrQuery instanceof Select) { | ||
@@ -37,11 +34,20 @@ this.joinSql.push(` ${ joinType } JOIN (${ tableNameOrQuery.toString(false) }) AS ${ tableAlias } ON ${ onCondition }`); | ||
leftJoin(tableNameOrQuery, tableAlias, onCondition, ...values) { | ||
return this._join(tableNameOrQuery, tableAlias, onCondition, 'LEFT', values); | ||
values.map(value => { | ||
onCondition = onCondition.replace(/\?/, this.escape(value)); | ||
}); | ||
return this._join(tableNameOrQuery, tableAlias, onCondition, 'LEFT'); | ||
} | ||
rightJoin(tableNameOrQuery, tableAlias, onCondition, ...values) { | ||
return this._join(tableNameOrQuery, tableAlias, onCondition, 'RIGHT', values); | ||
values.map(value => { | ||
onCondition = onCondition.replace(/\?/, this.escape(value)); | ||
}); | ||
return this._join(tableNameOrQuery, tableAlias, onCondition, 'RIGHT'); | ||
} | ||
innerJoin(tableNameOrQuery, tableAlias, onCondition, ...values) { | ||
return this._join(tableNameOrQuery, tableAlias, onCondition, 'INNER', values); | ||
values.map(value => { | ||
onCondition = onCondition.replace(/\?/, this.escape(value)); | ||
}); | ||
return this._join(tableNameOrQuery, tableAlias, onCondition, 'INNER'); | ||
} | ||
@@ -48,0 +54,0 @@ |
{ | ||
"name": "mysql-generator", | ||
"version": "1.0.8", | ||
"version": "1.0.9", | ||
"description": "mysql generator", | ||
@@ -5,0 +5,0 @@ "main": "./index.js", |
23051
571