File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed
packages/cubejs-client-core Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -731,6 +731,11 @@ declare module '@cubejs-client/core' {
731731 query ( ) : Query ;
732732 rawData ( ) : T [ ] ;
733733 annotation ( ) : QueryAnnotations ;
734+
735+ /**
736+ * @return the total number of rows if the `total` option was set, when sending the query
737+ */
738+ totalRows ( ) : number | null ;
734739 }
735740
736741 export type Filter = BinaryFilter | UnaryFilter | LogicalOrFilter | LogicalAndFilter ;
Original file line number Diff line number Diff line change @@ -701,6 +701,10 @@ class ResultSet {
701701 return this . loadResponse . pivotQuery || null ;
702702 }
703703
704+ totalRows ( ) {
705+ return this . loadResponses [ 0 ] . total ;
706+ }
707+
704708 rawData ( ) {
705709 if ( this . queryType !== QUERY_TYPE . REGULAR_QUERY ) {
706710 throw new Error ( `Method is not supported for a '${ this . queryType } ' query type. Please use decompose` ) ;
You can’t perform that action at this time.
0 commit comments