@@ -150,7 +150,7 @@ export class QueryBuilder<
150150 /**
151151 * Calculate the average of a given column using distinct.
152152 */
153- public async count ( column : string | ModelColumns < T > = '*' ) : Promise < string > {
153+ public async count ( column : string | ModelColumns < T > = '*' ) : Promise < number > {
154154 return this . driver . count ( column as string )
155155 }
156156
@@ -159,7 +159,7 @@ export class QueryBuilder<
159159 */
160160 public async countDistinct (
161161 column : string | ModelColumns < T >
162- ) : Promise < string > {
162+ ) : Promise < number > {
163163 return this . driver . countDistinct ( column as string )
164164 }
165165
@@ -583,24 +583,6 @@ export class QueryBuilder<
583583 return this
584584 }
585585
586- /**
587- * Set a having exists statement in your query.
588- */
589- public havingExists ( closure : ( query : Driver ) => void ) {
590- this . driver . havingExists ( closure )
591-
592- return this
593- }
594-
595- /**
596- * Set a having not exists statement in your query.
597- */
598- public havingNotExists ( closure : ( query : Driver ) => void ) {
599- this . driver . havingNotExists ( closure )
600-
601- return this
602- }
603-
604586 /**
605587 * Set a having in statement in your query.
606588 */
@@ -680,33 +662,6 @@ export class QueryBuilder<
680662 return this
681663 }
682664
683- /**
684- * Set an or having exists statement in your query.
685- */
686- public orHavingExists ( closure : ( query : Driver ) => void ) {
687- this . driver . orHavingExists ( closure )
688-
689- return this
690- }
691-
692- /**
693- * Set an or having not exists statement in your query.
694- */
695- public orHavingNotExists ( closure : ( query : Driver ) => void ) {
696- this . driver . orHavingNotExists ( closure )
697-
698- return this
699- }
700-
701- /**
702- * Set an or having in statement in your query.
703- */
704- public orHavingIn ( column : string | ModelColumns < T > , values : any [ ] ) {
705- this . driver . orHavingIn ( column as string , values )
706-
707- return this
708- }
709-
710665 /**
711666 * Set an or having not in statement in your query.
712667 */
@@ -887,6 +842,27 @@ export class QueryBuilder<
887842 return this
888843 }
889844
845+ public whereJson (
846+ column : string | ModelColumns < T > ,
847+ operation : any ,
848+ value ?: any
849+ ) : this
850+
851+ public whereJson ( column : string | ModelColumns < T > , value : any ) : this
852+
853+ /**
854+ * Set a where json statement in your query.
855+ */
856+ public whereJson (
857+ column : string | ModelColumns < T > ,
858+ operation : any ,
859+ value ?: any
860+ ) {
861+ this . driver . whereJson ( column as string , operation , value )
862+
863+ return this
864+ }
865+
890866 public orWhere ( statement : ( query : this) => void ) : this
891867 public orWhere ( statement : Partial < T > ) : this
892868 public orWhere ( statement : Record < string , any > ) : this
@@ -1030,6 +1006,27 @@ export class QueryBuilder<
10301006 return this
10311007 }
10321008
1009+ public orWhereJson (
1010+ column : string | ModelColumns < T > ,
1011+ operation : Operations ,
1012+ value ?: any
1013+ ) : this
1014+
1015+ public orWhereJson ( column : string | ModelColumns < T > , value : any ) : this
1016+
1017+ /**
1018+ * Set an orWhereJson statement in your query.
1019+ */
1020+ public orWhereJson (
1021+ column : string | ModelColumns < T > ,
1022+ operation : Operations ,
1023+ value ?: any
1024+ ) {
1025+ this . driver . orWhereJson ( column as string , operation , value )
1026+
1027+ return this
1028+ }
1029+
10331030 /**
10341031 * Set an order by statement in your query.
10351032 */
0 commit comments