mirror of
https://github.com/knex/knex.git
synced 2025-07-08 17:43:24 +00:00
38 lines
803 B
JavaScript
38 lines
803 B
JavaScript
![]() |
(function(define) {
|
||
|
|
||
|
"use strict";
|
||
|
|
||
|
// JoinClause
|
||
|
// ---------
|
||
|
define(function(require, exports) {
|
||
|
|
||
|
var JoinClause = function(type, table) {
|
||
|
this.clauses = [];
|
||
|
this.type = type;
|
||
|
this.table = table;
|
||
|
};
|
||
|
|
||
|
JoinClause.prototype = {
|
||
|
|
||
|
on: function(first, operator, second) {
|
||
|
this.clauses.push({first: first, operator: operator, second: second, bool: 'and'});
|
||
|
return this;
|
||
|
},
|
||
|
|
||
|
andOn: function() {
|
||
|
return this.on.apply(this, arguments);
|
||
|
},
|
||
|
|
||
|
orOn: function(first, operator, second) {
|
||
|
this.clauses.push({first: first, operator: operator, second: second, bool: 'or'});
|
||
|
return this;
|
||
|
}
|
||
|
};
|
||
|
|
||
|
exports.JoinClause = JoinClause;
|
||
|
|
||
|
});
|
||
|
|
||
|
})(
|
||
|
typeof define === 'function' && define.amd ? define : function (factory) { factory(require, exports); }
|
||
|
);
|