What's New With 3.7.0

Added

  • CBORM-29 Allow SQL and SQL Group projections to be functions containing commas
Example:
1
r = categoryCriteria
2
.withProjections(
3
groupProperty = "catid",
4
sqlProjection = [
5
{
6
sql : "count( category_id )",
7
alias : "count",
8
property : "catid"
9
}
10
],
11
sqlGroupProjection = [
12
{
13
sql : "year( modifydate )",
14
group : "year( modifydate )",
15
alias : "modifiedDate",
16
property : "id"
17
},
18
{
19
sql : "dateDiff('2021-12-31 23:59:59','2021-12-30')",
20
group : "dateDiff('2021-12-31 23:59:59','2021-12-30')",
21
alias : "someDateDiff",
22
property : "id"
23
}
24
]
25
)
26
.asStruct()
27
.peek( function( c ){
28
debug( c.getSql( true, true ) );
29
} )
30
.list();
31
32
debug( r );
33
assertTrue( isArray( r ) );
Copied!
Export as PDF
Copy link
Edit on GitHub