Skip to content

Commit a91c250

Browse files
committed
Added notes for new ideas
1 parent 030b44f commit a91c250

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Griddly.Mvc/DapperGriddlyResult.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,16 @@ public override long GetCount()
102102

103103
public override IList<T> GetPage(int pageNumber, int pageSize, SortField[] sortFields)
104104
{
105+
/* TODO: grab the count all at once like this:
106+
* TODO: also grab the other summary values in the _count branch too
107+
;WITH _data AS (
108+
select * from fin_lineitem where not oldpk is null
109+
),
110+
_count AS (
111+
SELECT COUNT(0) AS _AllRows FROM _data
112+
)
113+
SELECT * FROM _data CROSS APPLY _count ORDER BY CURRENT_TIMESTAMP OFFSET 50 ROWS FETCH NEXT 50 ROWS ONLY
114+
*/
105115
string sql = string.Format("{0} " + (_fixedSort ? "" : "ORDER BY {1}") + " OFFSET {2} ROWS FETCH NEXT {3} ROWS ONLY", _sql, BuildSortClause(sortFields), pageNumber * pageSize, pageSize);
106116

107117
return ExecuteQuery(sql, _param);

0 commit comments

Comments
 (0)