@@ -108,7 +108,6 @@ export default class Paginator<Entity> {
108108
109109 private appendPagingQuery ( builder : SelectQueryBuilder < Entity > ) : SelectQueryBuilder < Entity > {
110110 const cursors : CursorParam = { } ;
111- const { escape } = builder . connection . driver ;
112111
113112 if ( this . hasAfterCursor ( ) ) {
114113 Object . assign ( cursors , this . decode ( this . afterCursor as string ) ) ;
@@ -117,7 +116,7 @@ export default class Paginator<Entity> {
117116 }
118117
119118 if ( Object . keys ( cursors ) . length > 0 ) {
120- builder . andWhere ( new Brackets ( ( where ) => this . buildCursorQuery ( where , cursors , escape ) ) ) ;
119+ builder . andWhere ( new Brackets ( ( where ) => this . buildCursorQuery ( where , cursors ) ) ) ;
121120 }
122121
123122 builder . take ( this . limit + 1 ) ;
@@ -126,14 +125,14 @@ export default class Paginator<Entity> {
126125 return builder ;
127126 }
128127
129- private buildCursorQuery ( where : WhereExpression , cursors : CursorParam , escape : EscapeFn ) : void {
128+ private buildCursorQuery ( where : WhereExpression , cursors : CursorParam ) : void {
130129 const operator = this . getOperator ( ) ;
131130 const params : CursorParam = { } ;
132131 let query = '' ;
133132 this . paginationKeys . forEach ( ( key ) => {
134133 params [ key ] = cursors [ key ] ;
135- where . orWhere ( `${ query } ${ escape ( this . alias ) } ." ${ key } " ${ operator } :${ key } ` , params ) ;
136- query = `${ query } ${ escape ( this . alias ) } ." ${ key } " = :${ key } AND ` ;
134+ where . orWhere ( `${ query } ${ this . alias } . ${ key } ${ operator } :${ key } ` , params ) ;
135+ query = `${ query } ${ this . alias } . ${ key } = :${ key } AND ` ;
137136 } ) ;
138137 }
139138
0 commit comments