Skip to content

Commit f45b392

Browse files
committed
Rename aggregate to aggregation
1 parent 4d047d7 commit f45b392

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

src/deriveSqlClauses/projection.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {addToArray, arrayJoin} from '../arrayUtils';
22
import deriveAggregateFields from './aggregation';
33

4-
export default function projection({fields, groupBy, aggregate}) {
4+
export default function projection({fields, groupBy, aggregation}) {
55
const projectionList = [];
66

77
// either set fields or groupby as a base
@@ -12,8 +12,8 @@ export default function projection({fields, groupBy, aggregate}) {
1212
addToArray(projectionList, groupBy);
1313
}
1414

15-
// now add aggregate fields
16-
addToArray(projectionList, deriveAggregateFields(aggregate));
15+
// now add aggregation fields
16+
addToArray(projectionList, deriveAggregateFields(aggregation));
1717

1818
return arrayJoin(projectionList, ', ');
1919
}

src/deriveSqlClauses/test/projection.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ describe('testing projection output', () => {
44
it('when fields are defined', () => {
55
const out = deriveProjection({
66
fields: ['A', 'B', 'C'],
7-
aggregate: [
7+
aggregation: [
88
{
99
fn: 'count',
1010
args: '*',
@@ -19,7 +19,7 @@ describe('testing projection output', () => {
1919
it('when fields are not defined', () => {
2020
const out = deriveProjection({
2121
fields: [],
22-
aggregate: [
22+
aggregation: [
2323
{
2424
fn: 'count',
2525
args: '*',

src/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ import {deriveProjection, deriveGroupBy, deriveOrderBy, deriveLimit} from './der
88
const convertObjValues2List = composeObjValueMapper(arrify);
99

1010
export const select = function select(selectConfigs) {
11-
const arrifiedSelectConfigs = convertObjValues2List(selectConfigs, ['groupBy', 'aggregate', 'fields', 'orderBy']);
12-
const {fields, aggregate, from, where, groupBy, having, orderBy, limit, misc} = arrifiedSelectConfigs;
11+
const arrifiedSelectConfigs = convertObjValues2List(selectConfigs, ['groupBy', 'aggregation', 'fields', 'orderBy']);
12+
const {fields, aggregation, from, where, groupBy, having, orderBy, limit, misc} = arrifiedSelectConfigs;
1313

14-
const projectionFields = deriveProjection({fields, groupBy, aggregate});
14+
const projectionFields = deriveProjection({fields, groupBy, aggregation});
1515
const whereClause = buildWhereClause.build(where);
1616
const havingClause = buildWhereClause.build(having);
1717
const groupByClause = deriveGroupBy(groupBy);

src/test/index.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ describe('testing json2sql module', () => {
55
[
66
{
77
fields: ['A', 'B'],
8-
aggregate: [
8+
aggregation: [
99
{
1010
fn: 'count',
1111
args: 'D',
@@ -52,7 +52,7 @@ describe('testing json2sql module', () => {
5252
],
5353
[
5454
{
55-
aggregate: [
55+
aggregation: [
5656
{
5757
clause: 'uniq(name)',
5858
alias: 'UniquesNames'
@@ -146,7 +146,7 @@ describe('testing json2sql module', () => {
146146
[
147147
{
148148
fields: ['A', 'B'],
149-
aggregate: [
149+
aggregation: [
150150
{
151151
fn: 'count',
152152
args: 'D',

0 commit comments

Comments
 (0)