File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 1+ import { SQLKITException } from "../exceptions" ;
12import {
23 Join ,
34 OrderBy ,
@@ -98,6 +99,10 @@ export class SelectQueryBuilder<T> extends BaseQueryBuilder<T> {
9899 }
99100
100101 async paginate ( options : PaginationOptions < T > ) : Promise < PaginatedResult < T > > {
102+ if ( ! this ?. executor ) {
103+ throw new SQLKITException ( "Executor is not set for the query builder." ) ;
104+ }
105+
101106 const limit = options . limit || 10 ;
102107 const page = options . page || 1 ;
103108 const offset = ( page - 1 ) * limit ;
@@ -132,7 +137,7 @@ export class SelectQueryBuilder<T> extends BaseQueryBuilder<T> {
132137 }
133138 ` ;
134139
135- const countResult = await this . executor . executeSQL (
140+ const countResult : any = await this . executor . executeSQL (
136141 countSql ,
137142 buildWhereClause ( options . where , this . tableName ) . values
138143 ) ;
You can’t perform that action at this time.
0 commit comments