File tree Expand file tree Collapse file tree 18 files changed +324
-0
lines changed Expand file tree Collapse file tree 18 files changed +324
-0
lines changed Original file line number Diff line number Diff line change @@ -1658,6 +1658,24 @@ export async function generateModelString(
1658
1658
whereBetween(column: keyof ${ modelName } Type, range: [any, any]): ${ modelName } Model {
1659
1659
return ${ modelName } Model.whereBetween(column, range)
1660
1660
}
1661
+
1662
+ whereLike(column: keyof ${ modelName } Type, value: string): ${ modelName } Model {
1663
+ return ${ modelName } Model.whereLike(column, value)
1664
+ }
1665
+
1666
+ static whereLike(column: keyof ${ modelName } Type, value: string): ${ modelName } Model {
1667
+ const instance = new ${ modelName } Model(null)
1668
+
1669
+ const query = sql\` \${sql.raw(column as string)} between \${range[0]} and \${range[1]} \`
1670
+
1671
+ instance.selectFromQuery = instance.selectFromQuery.where(column, 'LIKE', values)
1672
+
1673
+ instance.updateFromQuery = instance.updateFromQuery.where(column, 'LIKE', values)
1674
+
1675
+ instance.deleteFromQuery = instance.deleteFromQuery.where(column, 'LIKE', values)
1676
+
1677
+ return instance
1678
+ }
1661
1679
1662
1680
static whereBetween(column: keyof ${ modelName } Type, range: [any, any]): ${ modelName } Model {
1663
1681
if (range.length !== 2) {
Original file line number Diff line number Diff line change @@ -902,6 +902,24 @@ export class AccessTokenModel {
902
902
return AccessTokenModel . whereBetween ( column , range )
903
903
}
904
904
905
+ whereLike ( column : keyof AccessTokenType , value : string ) : AccessTokenModel {
906
+ return AccessTokenModel . whereLike ( column , value )
907
+ }
908
+
909
+ static whereLike ( column : keyof AccessTokenType , value : string ) : AccessTokenModel {
910
+ const instance = new AccessTokenModel ( null )
911
+
912
+ const query = sql ` ${ sql . raw ( column as string ) } between ${ range [ 0 ] } and ${ range [ 1 ] } `
913
+
914
+ instance . selectFromQuery = instance . selectFromQuery . where ( column , 'LIKE' , values )
915
+
916
+ instance . updateFromQuery = instance . updateFromQuery . where ( column , 'LIKE' , values )
917
+
918
+ instance . deleteFromQuery = instance . deleteFromQuery . where ( column , 'LIKE' , values )
919
+
920
+ return instance
921
+ }
922
+
905
923
static whereBetween ( column : keyof AccessTokenType , range : [ any , any ] ) : AccessTokenModel {
906
924
if ( range . length !== 2 ) {
907
925
throw new HttpError ( 500 , 'Range must have exactly two values: [min, max]' )
Original file line number Diff line number Diff line change @@ -956,6 +956,24 @@ export class ActivityModel {
956
956
return ActivityModel . whereBetween ( column , range )
957
957
}
958
958
959
+ whereLike ( column : keyof ActivityType , value : string ) : ActivityModel {
960
+ return ActivityModel . whereLike ( column , value )
961
+ }
962
+
963
+ static whereLike ( column : keyof ActivityType , value : string ) : ActivityModel {
964
+ const instance = new ActivityModel ( null )
965
+
966
+ const query = sql ` ${ sql . raw ( column as string ) } between ${ range [ 0 ] } and ${ range [ 1 ] } `
967
+
968
+ instance . selectFromQuery = instance . selectFromQuery . where ( column , 'LIKE' , values )
969
+
970
+ instance . updateFromQuery = instance . updateFromQuery . where ( column , 'LIKE' , values )
971
+
972
+ instance . deleteFromQuery = instance . deleteFromQuery . where ( column , 'LIKE' , values )
973
+
974
+ return instance
975
+ }
976
+
959
977
static whereBetween ( column : keyof ActivityType , range : [ any , any ] ) : ActivityModel {
960
978
if ( range . length !== 2 ) {
961
979
throw new HttpError ( 500 , 'Range must have exactly two values: [min, max]' )
Original file line number Diff line number Diff line change @@ -967,6 +967,24 @@ export class DeploymentModel {
967
967
return DeploymentModel . whereBetween ( column , range )
968
968
}
969
969
970
+ whereLike ( column : keyof DeploymentType , value : string ) : DeploymentModel {
971
+ return DeploymentModel . whereLike ( column , value )
972
+ }
973
+
974
+ static whereLike ( column : keyof DeploymentType , value : string ) : DeploymentModel {
975
+ const instance = new DeploymentModel ( null )
976
+
977
+ const query = sql ` ${ sql . raw ( column as string ) } between ${ range [ 0 ] } and ${ range [ 1 ] } `
978
+
979
+ instance . selectFromQuery = instance . selectFromQuery . where ( column , 'LIKE' , values )
980
+
981
+ instance . updateFromQuery = instance . updateFromQuery . where ( column , 'LIKE' , values )
982
+
983
+ instance . deleteFromQuery = instance . deleteFromQuery . where ( column , 'LIKE' , values )
984
+
985
+ return instance
986
+ }
987
+
970
988
static whereBetween ( column : keyof DeploymentType , range : [ any , any ] ) : DeploymentModel {
971
989
if ( range . length !== 2 ) {
972
990
throw new HttpError ( 500 , 'Range must have exactly two values: [min, max]' )
Original file line number Diff line number Diff line change @@ -902,6 +902,24 @@ export class ErrorModel {
902
902
return ErrorModel . whereBetween ( column , range )
903
903
}
904
904
905
+ whereLike ( column : keyof ErrorType , value : string ) : ErrorModel {
906
+ return ErrorModel . whereLike ( column , value )
907
+ }
908
+
909
+ static whereLike ( column : keyof ErrorType , value : string ) : ErrorModel {
910
+ const instance = new ErrorModel ( null )
911
+
912
+ const query = sql ` ${ sql . raw ( column as string ) } between ${ range [ 0 ] } and ${ range [ 1 ] } `
913
+
914
+ instance . selectFromQuery = instance . selectFromQuery . where ( column , 'LIKE' , values )
915
+
916
+ instance . updateFromQuery = instance . updateFromQuery . where ( column , 'LIKE' , values )
917
+
918
+ instance . deleteFromQuery = instance . deleteFromQuery . where ( column , 'LIKE' , values )
919
+
920
+ return instance
921
+ }
922
+
905
923
static whereBetween ( column : keyof ErrorType , range : [ any , any ] ) : ErrorModel {
906
924
if ( range . length !== 2 ) {
907
925
throw new HttpError ( 500 , 'Range must have exactly two values: [min, max]' )
Original file line number Diff line number Diff line change @@ -902,6 +902,24 @@ export class FailedJobModel {
902
902
return FailedJobModel . whereBetween ( column , range )
903
903
}
904
904
905
+ whereLike ( column : keyof FailedJobType , value : string ) : FailedJobModel {
906
+ return FailedJobModel . whereLike ( column , value )
907
+ }
908
+
909
+ static whereLike ( column : keyof FailedJobType , value : string ) : FailedJobModel {
910
+ const instance = new FailedJobModel ( null )
911
+
912
+ const query = sql ` ${ sql . raw ( column as string ) } between ${ range [ 0 ] } and ${ range [ 1 ] } `
913
+
914
+ instance . selectFromQuery = instance . selectFromQuery . where ( column , 'LIKE' , values )
915
+
916
+ instance . updateFromQuery = instance . updateFromQuery . where ( column , 'LIKE' , values )
917
+
918
+ instance . deleteFromQuery = instance . deleteFromQuery . where ( column , 'LIKE' , values )
919
+
920
+ return instance
921
+ }
922
+
905
923
static whereBetween ( column : keyof FailedJobType , range : [ any , any ] ) : FailedJobModel {
906
924
if ( range . length !== 2 ) {
907
925
throw new HttpError ( 500 , 'Range must have exactly two values: [min, max]' )
Original file line number Diff line number Diff line change @@ -902,6 +902,24 @@ export class JobModel {
902
902
return JobModel . whereBetween ( column , range )
903
903
}
904
904
905
+ whereLike ( column : keyof JobType , value : string ) : JobModel {
906
+ return JobModel . whereLike ( column , value )
907
+ }
908
+
909
+ static whereLike ( column : keyof JobType , value : string ) : JobModel {
910
+ const instance = new JobModel ( null )
911
+
912
+ const query = sql ` ${ sql . raw ( column as string ) } between ${ range [ 0 ] } and ${ range [ 1 ] } `
913
+
914
+ instance . selectFromQuery = instance . selectFromQuery . where ( column , 'LIKE' , values )
915
+
916
+ instance . updateFromQuery = instance . updateFromQuery . where ( column , 'LIKE' , values )
917
+
918
+ instance . deleteFromQuery = instance . deleteFromQuery . where ( column , 'LIKE' , values )
919
+
920
+ return instance
921
+ }
922
+
905
923
static whereBetween ( column : keyof JobType , range : [ any , any ] ) : JobModel {
906
924
if ( range . length !== 2 ) {
907
925
throw new HttpError ( 500 , 'Range must have exactly two values: [min, max]' )
Original file line number Diff line number Diff line change @@ -980,6 +980,24 @@ export class PaymentMethodModel {
980
980
return PaymentMethodModel . whereBetween ( column , range )
981
981
}
982
982
983
+ whereLike ( column : keyof PaymentMethodType , value : string ) : PaymentMethodModel {
984
+ return PaymentMethodModel . whereLike ( column , value )
985
+ }
986
+
987
+ static whereLike ( column : keyof PaymentMethodType , value : string ) : PaymentMethodModel {
988
+ const instance = new PaymentMethodModel ( null )
989
+
990
+ const query = sql ` ${ sql . raw ( column as string ) } between ${ range [ 0 ] } and ${ range [ 1 ] } `
991
+
992
+ instance . selectFromQuery = instance . selectFromQuery . where ( column , 'LIKE' , values )
993
+
994
+ instance . updateFromQuery = instance . updateFromQuery . where ( column , 'LIKE' , values )
995
+
996
+ instance . deleteFromQuery = instance . deleteFromQuery . where ( column , 'LIKE' , values )
997
+
998
+ return instance
999
+ }
1000
+
983
1001
static whereBetween ( column : keyof PaymentMethodType , range : [ any , any ] ) : PaymentMethodModel {
984
1002
if ( range . length !== 2 ) {
985
1003
throw new HttpError ( 500 , 'Range must have exactly two values: [min, max]' )
Original file line number Diff line number Diff line change @@ -868,6 +868,24 @@ export class PostModel {
868
868
return PostModel . whereBetween ( column , range )
869
869
}
870
870
871
+ whereLike ( column : keyof PostType , value : string ) : PostModel {
872
+ return PostModel . whereLike ( column , value )
873
+ }
874
+
875
+ static whereLike ( column : keyof PostType , value : string ) : PostModel {
876
+ const instance = new PostModel ( null )
877
+
878
+ const query = sql ` ${ sql . raw ( column as string ) } between ${ range [ 0 ] } and ${ range [ 1 ] } `
879
+
880
+ instance . selectFromQuery = instance . selectFromQuery . where ( column , 'LIKE' , values )
881
+
882
+ instance . updateFromQuery = instance . updateFromQuery . where ( column , 'LIKE' , values )
883
+
884
+ instance . deleteFromQuery = instance . deleteFromQuery . where ( column , 'LIKE' , values )
885
+
886
+ return instance
887
+ }
888
+
871
889
static whereBetween ( column : keyof PostType , range : [ any , any ] ) : PostModel {
872
890
if ( range . length !== 2 ) {
873
891
throw new HttpError ( 500 , 'Range must have exactly two values: [min, max]' )
Original file line number Diff line number Diff line change @@ -950,6 +950,24 @@ export class ProductModel {
950
950
return ProductModel . whereBetween ( column , range )
951
951
}
952
952
953
+ whereLike ( column : keyof ProductType , value : string ) : ProductModel {
954
+ return ProductModel . whereLike ( column , value )
955
+ }
956
+
957
+ static whereLike ( column : keyof ProductType , value : string ) : ProductModel {
958
+ const instance = new ProductModel ( null )
959
+
960
+ const query = sql ` ${ sql . raw ( column as string ) } between ${ range [ 0 ] } and ${ range [ 1 ] } `
961
+
962
+ instance . selectFromQuery = instance . selectFromQuery . where ( column , 'LIKE' , values )
963
+
964
+ instance . updateFromQuery = instance . updateFromQuery . where ( column , 'LIKE' , values )
965
+
966
+ instance . deleteFromQuery = instance . deleteFromQuery . where ( column , 'LIKE' , values )
967
+
968
+ return instance
969
+ }
970
+
953
971
static whereBetween ( column : keyof ProductType , range : [ any , any ] ) : ProductModel {
954
972
if ( range . length !== 2 ) {
955
973
throw new HttpError ( 500 , 'Range must have exactly two values: [min, max]' )
You can’t perform that action at this time.
0 commit comments