Comparing version 0.1.9 to 0.1.10
10
mql.js
import { | ||
is_string, is_function, flatten, flatten as cat, reduce, tap, go, pipe, | ||
map, filter, reject, pluck, uniq, each, index_by, group_by, object, curry | ||
map, filter, reject, pluck, uniq, each, index_by, group_by, uniqueBy, object, curry | ||
} from 'fxjs2'; | ||
@@ -29,2 +29,4 @@ import pg from 'pg'; | ||
const cmap = curry((f, arr) => Promise.all(arr.map(f))); | ||
const uniq_index_by = curry((f, coll) => index_by(f, uniqueBy(f, coll))); | ||
const first = a => a && a[0]; | ||
@@ -41,4 +43,2 @@ const last = a => a && a[a.length - 1]; | ||
const add_s = word => last(word) == 'y' | ||
function BASE({ | ||
@@ -297,3 +297,3 @@ create_pool, | ||
var xtable = me.xtable || (left.table + '_' + me.table); | ||
me.xjoin = SQL `INNER JOIN ${TB(xtable)} as ${escape_dq('_#_xtable_#_')} on ${EQ({ | ||
me.xjoin = SQL `INNER JOIN ${TB(xtable)} AS ${TB('_#_xtable_#_')} on ${EQ({ | ||
['_#_xtable_#_.' + (me.xkey || singular(me.table) + '_id')]: COLUMN(me.as + '.' + (me.key || 'id')) | ||
@@ -347,3 +347,3 @@ })}`; | ||
const [folder, default_value] = me.rel_type == '-' ? [index_by, () => ({})] : [group_by, () => []]; | ||
const [folder, default_value] = me.rel_type == '-' ? [uniq_index_by, () => ({})] : [group_by, () => []]; | ||
return go( | ||
@@ -350,0 +350,0 @@ rights, |
{ | ||
"name": "mql2", | ||
"version": "0.1.9", | ||
"version": "0.1.10", | ||
"description": "query builder", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
34206