Skip to content

Commit fe63251

Browse files
chore: wip
1 parent 47e2c84 commit fe63251

File tree

17 files changed

+204
-0
lines changed

17 files changed

+204
-0
lines changed

storage/framework/core/orm/src/generate.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1445,6 +1445,18 @@ export async function generateModelString(
14451445
return ${modelName}Model.applyWhere(instance, column, operator, value)
14461446
}
14471447
1448+
whereColumn(first: string, operator: string, second: string): ${modelName}Model {
1449+
return ${modelName}Model.whereColumn(first, operator, second)
1450+
}
1451+
1452+
static whereColumn(first: string, operator: string, second: string): ${modelName}Model {
1453+
const instance = new ${modelName}Model(null)
1454+
1455+
instance.selectFromQuery = instance.selectFromQuery.whereRef(first, operator, second)
1456+
1457+
return instance
1458+
}
1459+
14481460
whereRef(column: string, operator: string, value: string): ${modelName}Model {
14491461
return ${modelName}Model.whereRef(column, operator, value)
14501462
}

storage/framework/orm/src/models/AccessToken.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,18 @@ export class AccessTokenModel {
738738
return AccessTokenModel.applyWhere(instance, column, operator, value)
739739
}
740740

741+
whereColumn(first: string, operator: string, second: string): AccessTokenModel {
742+
return AccessTokenModel.whereColumn(first, operator, second)
743+
}
744+
745+
static whereColumn(first: string, operator: string, second: string): AccessTokenModel {
746+
const instance = new AccessTokenModel(null)
747+
748+
instance.selectFromQuery = instance.selectFromQuery.whereRef(first, operator, second)
749+
750+
return instance
751+
}
752+
741753
whereRef(column: string, operator: string, value: string): AccessTokenModel {
742754
return AccessTokenModel.whereRef(column, operator, value)
743755
}

storage/framework/orm/src/models/Deployment.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -776,6 +776,18 @@ export class DeploymentModel {
776776
return DeploymentModel.applyWhere(instance, column, operator, value)
777777
}
778778

779+
whereColumn(first: string, operator: string, second: string): DeploymentModel {
780+
return DeploymentModel.whereColumn(first, operator, second)
781+
}
782+
783+
static whereColumn(first: string, operator: string, second: string): DeploymentModel {
784+
const instance = new DeploymentModel(null)
785+
786+
instance.selectFromQuery = instance.selectFromQuery.whereRef(first, operator, second)
787+
788+
return instance
789+
}
790+
779791
whereRef(column: string, operator: string, value: string): DeploymentModel {
780792
return DeploymentModel.whereRef(column, operator, value)
781793
}

storage/framework/orm/src/models/Error.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -730,6 +730,18 @@ export class ErrorModel {
730730
return ErrorModel.applyWhere(instance, column, operator, value)
731731
}
732732

733+
whereColumn(first: string, operator: string, second: string): ErrorModel {
734+
return ErrorModel.whereColumn(first, operator, second)
735+
}
736+
737+
static whereColumn(first: string, operator: string, second: string): ErrorModel {
738+
const instance = new ErrorModel(null)
739+
740+
instance.selectFromQuery = instance.selectFromQuery.whereRef(first, operator, second)
741+
742+
return instance
743+
}
744+
733745
whereRef(column: string, operator: string, value: string): ErrorModel {
734746
return ErrorModel.whereRef(column, operator, value)
735747
}

storage/framework/orm/src/models/FailedJob.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -730,6 +730,18 @@ export class FailedJobModel {
730730
return FailedJobModel.applyWhere(instance, column, operator, value)
731731
}
732732

733+
whereColumn(first: string, operator: string, second: string): FailedJobModel {
734+
return FailedJobModel.whereColumn(first, operator, second)
735+
}
736+
737+
static whereColumn(first: string, operator: string, second: string): FailedJobModel {
738+
const instance = new FailedJobModel(null)
739+
740+
instance.selectFromQuery = instance.selectFromQuery.whereRef(first, operator, second)
741+
742+
return instance
743+
}
744+
733745
whereRef(column: string, operator: string, value: string): FailedJobModel {
734746
return FailedJobModel.whereRef(column, operator, value)
735747
}

storage/framework/orm/src/models/Job.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -730,6 +730,18 @@ export class JobModel {
730730
return JobModel.applyWhere(instance, column, operator, value)
731731
}
732732

733+
whereColumn(first: string, operator: string, second: string): JobModel {
734+
return JobModel.whereColumn(first, operator, second)
735+
}
736+
737+
static whereColumn(first: string, operator: string, second: string): JobModel {
738+
const instance = new JobModel(null)
739+
740+
instance.selectFromQuery = instance.selectFromQuery.whereRef(first, operator, second)
741+
742+
return instance
743+
}
744+
733745
whereRef(column: string, operator: string, value: string): JobModel {
734746
return JobModel.whereRef(column, operator, value)
735747
}

storage/framework/orm/src/models/PaymentMethod.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -789,6 +789,18 @@ export class PaymentMethodModel {
789789
return PaymentMethodModel.applyWhere(instance, column, operator, value)
790790
}
791791

792+
whereColumn(first: string, operator: string, second: string): PaymentMethodModel {
793+
return PaymentMethodModel.whereColumn(first, operator, second)
794+
}
795+
796+
static whereColumn(first: string, operator: string, second: string): PaymentMethodModel {
797+
const instance = new PaymentMethodModel(null)
798+
799+
instance.selectFromQuery = instance.selectFromQuery.whereRef(first, operator, second)
800+
801+
return instance
802+
}
803+
792804
whereRef(column: string, operator: string, value: string): PaymentMethodModel {
793805
return PaymentMethodModel.whereRef(column, operator, value)
794806
}

storage/framework/orm/src/models/Post.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -720,6 +720,18 @@ export class PostModel {
720720
return PostModel.applyWhere(instance, column, operator, value)
721721
}
722722

723+
whereColumn(first: string, operator: string, second: string): PostModel {
724+
return PostModel.whereColumn(first, operator, second)
725+
}
726+
727+
static whereColumn(first: string, operator: string, second: string): PostModel {
728+
const instance = new PostModel(null)
729+
730+
instance.selectFromQuery = instance.selectFromQuery.whereRef(first, operator, second)
731+
732+
return instance
733+
}
734+
723735
whereRef(column: string, operator: string, value: string): PostModel {
724736
return PostModel.whereRef(column, operator, value)
725737
}

storage/framework/orm/src/models/Product.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -759,6 +759,18 @@ export class ProductModel {
759759
return ProductModel.applyWhere(instance, column, operator, value)
760760
}
761761

762+
whereColumn(first: string, operator: string, second: string): ProductModel {
763+
return ProductModel.whereColumn(first, operator, second)
764+
}
765+
766+
static whereColumn(first: string, operator: string, second: string): ProductModel {
767+
const instance = new ProductModel(null)
768+
769+
instance.selectFromQuery = instance.selectFromQuery.whereRef(first, operator, second)
770+
771+
return instance
772+
}
773+
762774
whereRef(column: string, operator: string, value: string): ProductModel {
763775
return ProductModel.whereRef(column, operator, value)
764776
}

storage/framework/orm/src/models/Project.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -721,6 +721,18 @@ export class ProjectModel {
721721
return ProjectModel.applyWhere(instance, column, operator, value)
722722
}
723723

724+
whereColumn(first: string, operator: string, second: string): ProjectModel {
725+
return ProjectModel.whereColumn(first, operator, second)
726+
}
727+
728+
static whereColumn(first: string, operator: string, second: string): ProjectModel {
729+
const instance = new ProjectModel(null)
730+
731+
instance.selectFromQuery = instance.selectFromQuery.whereRef(first, operator, second)
732+
733+
return instance
734+
}
735+
724736
whereRef(column: string, operator: string, value: string): ProjectModel {
725737
return ProjectModel.whereRef(column, operator, value)
726738
}

0 commit comments

Comments
 (0)