all files / lib/waterline/query/integrator/ leftOuterJoin.js

100% Statements 4/4
100% Branches 0/0
100% Functions 1/1
100% Lines 4/4
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27                                          38× 38×    
/**
 * Module dependencies
 */
var join = require('./_join');
 
 
/**
 * Left outer join
 *
 * Return a result set with data from child and parent
 * merged on childKey===parentKey, where t.e. at least one
 * entry for each row of parent (unmatched columns in child are null).
 *
 * @option {Array} parent       [rows from the "lefthand table"]
 * @option {Array} child        [rows from the "righthand table"]
 * @option {String} parentKey   [primary key of the "lefthand table"]
 * @option {String} childKey    [foreign key from the "righthand table" to the "lefthand table"]
 * @return {Array}              [a new array of joined row data]
 *
 * @throws {Error} on invalid input
 * @synchronous
 */
module.exports = function leftOuterJoin(options) {
  options.outer = 'left';
  return join(options);
};