mirror of
https://github.com/xfarrow/blink
synced 2025-06-27 09:03:02 +02:00
Change endpoint from persons to people
This commit is contained in:
52
backend/apis/nodejs/node_modules/knex/lib/query/analytic.js
generated
vendored
Normal file
52
backend/apis/nodejs/node_modules/knex/lib/query/analytic.js
generated
vendored
Normal file
@ -0,0 +1,52 @@
|
||||
const assert = require('assert');
|
||||
|
||||
// Analytic
|
||||
// -------
|
||||
|
||||
// The "Analytic" is an object holding any necessary info about a analytic function
|
||||
// e.g row_number, rank, dense_rank,
|
||||
class Analytic {
|
||||
constructor(method, schema, alias, orderBy, partitions) {
|
||||
this.schema = schema;
|
||||
this.type = 'analytic';
|
||||
this.method = method;
|
||||
this.order = orderBy || [];
|
||||
this.partitions = partitions || [];
|
||||
this.alias = alias;
|
||||
this.and = this;
|
||||
|
||||
this.grouping = 'columns';
|
||||
}
|
||||
|
||||
partitionBy(column, direction) {
|
||||
assert(
|
||||
Array.isArray(column) || typeof column === 'string',
|
||||
`The argument to an analytic partitionBy function must be either a string
|
||||
or an array of string.`
|
||||
);
|
||||
|
||||
if (Array.isArray(column)) {
|
||||
this.partitions = this.partitions.concat(column);
|
||||
} else {
|
||||
this.partitions.push({ column: column, order: direction });
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
orderBy(column, direction) {
|
||||
assert(
|
||||
Array.isArray(column) || typeof column === 'string',
|
||||
`The argument to an analytic orderBy function must be either a string
|
||||
or an array of string.`
|
||||
);
|
||||
|
||||
if (Array.isArray(column)) {
|
||||
this.order = this.order.concat(column);
|
||||
} else {
|
||||
this.order.push({ column: column, order: direction });
|
||||
}
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Analytic;
|
Reference in New Issue
Block a user