You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Date functions should be allowed in ORDER BY clause #139
Added date functions to order by clause
Modified names of functions / types (internal)
Removed improper import of `isString` from node utils
#139 (version 2.5.6)
// soql: `SELECT Id FROM Account WHERE NOT Id = '2'`,
1987
+
// output: {
1988
+
// fields: [
1989
+
// {
1990
+
// type: 'Field',
1991
+
// field: 'Id',
1992
+
// },
1993
+
// ],
1994
+
// sObject: 'Account',
1995
+
// where: {
1996
+
// left: null,
1997
+
// operator: 'NOT',
1998
+
// right: {
1999
+
// left: {
2000
+
// field: 'Id',
2001
+
// operator: '=',
2002
+
// value: "'2'",
2003
+
// literalType: 'STRING',
2004
+
// },
2005
+
// },
2006
+
// },
2007
+
// },
2008
+
// },
2009
+
{
2010
+
testCase: 106,
2011
+
soql: `SELECT WEEK_IN_YEAR(CloseDate), SUM(amount) FROM Opportunity GROUP BY WEEK_IN_YEAR(CloseDate) ORDER BY WEEK_IN_YEAR(CloseDate)`,
2012
+
output: {
2013
+
fields: [
2014
+
{
2015
+
type: 'FieldFunctionExpression',
2016
+
functionName: 'WEEK_IN_YEAR',
2017
+
parameters: ['CloseDate'],
2018
+
rawValue: 'WEEK_IN_YEAR(CloseDate)',
2019
+
},
2020
+
{
2021
+
type: 'FieldFunctionExpression',
2022
+
functionName: 'SUM',
2023
+
parameters: ['amount'],
2024
+
isAggregateFn: true,
2025
+
rawValue: 'SUM(amount)',
2026
+
},
2027
+
],
2028
+
sObject: 'Opportunity',
2029
+
groupBy: {
2030
+
fn: {
2031
+
functionName: 'WEEK_IN_YEAR',
2032
+
parameters: ['CloseDate'],
2033
+
rawValue: 'WEEK_IN_YEAR(CloseDate)',
2034
+
},
2035
+
},
2036
+
orderBy: {
2037
+
fn: {
2038
+
functionName: 'WEEK_IN_YEAR',
2039
+
parameters: ['CloseDate'],
2040
+
rawValue: 'WEEK_IN_YEAR(CloseDate)',
2041
+
},
2042
+
},
2043
+
},
2044
+
},
2045
+
{
2046
+
testCase: 107,
2047
+
soql: `SELECT WEEK_IN_YEAR(CloseDate), SUM(amount) FROM Opportunity GROUP BY WEEK_IN_YEAR(CloseDate) ORDER BY WEEK_IN_YEAR(CloseDate) DESC NULLS FIRST`,
2048
+
output: {
2049
+
fields: [
2050
+
{
2051
+
type: 'FieldFunctionExpression',
2052
+
functionName: 'WEEK_IN_YEAR',
2053
+
parameters: ['CloseDate'],
2054
+
rawValue: 'WEEK_IN_YEAR(CloseDate)',
2055
+
},
2056
+
{
2057
+
type: 'FieldFunctionExpression',
2058
+
functionName: 'SUM',
2059
+
parameters: ['amount'],
2060
+
isAggregateFn: true,
2061
+
rawValue: 'SUM(amount)',
2062
+
},
2063
+
],
2064
+
sObject: 'Opportunity',
2065
+
groupBy: {
2066
+
fn: {
2067
+
functionName: 'WEEK_IN_YEAR',
2068
+
parameters: ['CloseDate'],
2069
+
rawValue: 'WEEK_IN_YEAR(CloseDate)',
2070
+
},
2071
+
},
2072
+
orderBy: {
2073
+
fn: {
2074
+
functionName: 'WEEK_IN_YEAR',
2075
+
parameters: ['CloseDate'],
2076
+
rawValue: 'WEEK_IN_YEAR(CloseDate)',
2077
+
},
2078
+
order: 'DESC',
2079
+
nulls: 'FIRST',
2080
+
},
2081
+
},
2082
+
},
2083
+
{
2084
+
testCase: 108,
2085
+
soql: `SELECT WEEK_IN_YEAR(CloseDate), SUM(amount) FROM Opportunity GROUP BY WEEK_IN_YEAR(CloseDate) ORDER BY WEEK_IN_YEAR(CloseDate) DESC NULLS LAST, SUM(amount) ASC NULLS LAST`,
0 commit comments