File tree Expand file tree Collapse file tree 17 files changed +476
-0
lines changed Expand file tree Collapse file tree 17 files changed +476
-0
lines changed Original file line number Diff line number Diff line change @@ -876,6 +876,34 @@ export async function generateModelString(
876
876
return model.map(modelItem => instance.parseResult(new ${ modelName } Model(modelItem)))
877
877
}
878
878
879
+ static skip(count: number): ${ modelName } Model {
880
+ const instance = new ${ modelName } Model(null)
881
+
882
+ instance.selectFromQuery = instance.selectFromQuery.offset(count)
883
+
884
+ return instance
885
+ }
886
+
887
+ skip(count: number): ${ modelName } Model {
888
+ this.selectFromQuery = this.selectFromQuery.offset(count)
889
+
890
+ return this
891
+ }
892
+
893
+ static take(count: number): ${ modelName } Model {
894
+ const instance = new ${ modelName } Model(null)
895
+
896
+ instance.selectFromQuery = instance.selectFromQuery.limit(count)
897
+
898
+ return instance
899
+ }
900
+
901
+ take(count: number): this {
902
+ this.selectFromQuery = this.selectFromQuery.limit(count)
903
+
904
+ return this
905
+ }
906
+
879
907
async pluck<K extends keyof ${ modelName } Model>(field: K): Promise<${ modelName } Model[K][]> {
880
908
if (this.hasSelect) {
881
909
const model = await this.selectFromQuery.execute()
Original file line number Diff line number Diff line change @@ -211,6 +211,34 @@ export class AccessTokenModel {
211
211
return model . map ( modelItem => instance . parseResult ( new AccessTokenModel ( modelItem ) ) )
212
212
}
213
213
214
+ static skip ( count : number ) : AccessTokenModel {
215
+ const instance = new AccessTokenModel ( null )
216
+
217
+ instance . selectFromQuery = instance . selectFromQuery . offset ( count )
218
+
219
+ return instance
220
+ }
221
+
222
+ skip ( count : number ) : AccessTokenModel {
223
+ this . selectFromQuery = this . selectFromQuery . offset ( count )
224
+
225
+ return this
226
+ }
227
+
228
+ static take ( count : number ) : AccessTokenModel {
229
+ const instance = new AccessTokenModel ( null )
230
+
231
+ instance . selectFromQuery = instance . selectFromQuery . limit ( count )
232
+
233
+ return instance
234
+ }
235
+
236
+ take ( count : number ) : this {
237
+ this . selectFromQuery = this . selectFromQuery . limit ( count )
238
+
239
+ return this
240
+ }
241
+
214
242
async pluck < K extends keyof AccessTokenModel > ( field : K ) : Promise < AccessTokenModel [ K ] [ ] > {
215
243
if ( this . hasSelect ) {
216
244
const model = await this . selectFromQuery . execute ( )
Original file line number Diff line number Diff line change @@ -224,6 +224,34 @@ export class DeploymentModel {
224
224
return model . map ( modelItem => instance . parseResult ( new DeploymentModel ( modelItem ) ) )
225
225
}
226
226
227
+ static skip ( count : number ) : DeploymentModel {
228
+ const instance = new DeploymentModel ( null )
229
+
230
+ instance . selectFromQuery = instance . selectFromQuery . offset ( count )
231
+
232
+ return instance
233
+ }
234
+
235
+ skip ( count : number ) : DeploymentModel {
236
+ this . selectFromQuery = this . selectFromQuery . offset ( count )
237
+
238
+ return this
239
+ }
240
+
241
+ static take ( count : number ) : DeploymentModel {
242
+ const instance = new DeploymentModel ( null )
243
+
244
+ instance . selectFromQuery = instance . selectFromQuery . limit ( count )
245
+
246
+ return instance
247
+ }
248
+
249
+ take ( count : number ) : this {
250
+ this . selectFromQuery = this . selectFromQuery . limit ( count )
251
+
252
+ return this
253
+ }
254
+
227
255
async pluck < K extends keyof DeploymentModel > ( field : K ) : Promise < DeploymentModel [ K ] [ ] > {
228
256
if ( this . hasSelect ) {
229
257
const model = await this . selectFromQuery . execute ( )
Original file line number Diff line number Diff line change @@ -201,6 +201,34 @@ export class ErrorModel {
201
201
return model . map ( modelItem => instance . parseResult ( new ErrorModel ( modelItem ) ) )
202
202
}
203
203
204
+ static skip ( count : number ) : ErrorModel {
205
+ const instance = new ErrorModel ( null )
206
+
207
+ instance . selectFromQuery = instance . selectFromQuery . offset ( count )
208
+
209
+ return instance
210
+ }
211
+
212
+ skip ( count : number ) : ErrorModel {
213
+ this . selectFromQuery = this . selectFromQuery . offset ( count )
214
+
215
+ return this
216
+ }
217
+
218
+ static take ( count : number ) : ErrorModel {
219
+ const instance = new ErrorModel ( null )
220
+
221
+ instance . selectFromQuery = instance . selectFromQuery . limit ( count )
222
+
223
+ return instance
224
+ }
225
+
226
+ take ( count : number ) : this {
227
+ this . selectFromQuery = this . selectFromQuery . limit ( count )
228
+
229
+ return this
230
+ }
231
+
204
232
async pluck < K extends keyof ErrorModel > ( field : K ) : Promise < ErrorModel [ K ] [ ] > {
205
233
if ( this . hasSelect ) {
206
234
const model = await this . selectFromQuery . execute ( )
Original file line number Diff line number Diff line change @@ -201,6 +201,34 @@ export class FailedJobModel {
201
201
return model . map ( modelItem => instance . parseResult ( new FailedJobModel ( modelItem ) ) )
202
202
}
203
203
204
+ static skip ( count : number ) : FailedJobModel {
205
+ const instance = new FailedJobModel ( null )
206
+
207
+ instance . selectFromQuery = instance . selectFromQuery . offset ( count )
208
+
209
+ return instance
210
+ }
211
+
212
+ skip ( count : number ) : FailedJobModel {
213
+ this . selectFromQuery = this . selectFromQuery . offset ( count )
214
+
215
+ return this
216
+ }
217
+
218
+ static take ( count : number ) : FailedJobModel {
219
+ const instance = new FailedJobModel ( null )
220
+
221
+ instance . selectFromQuery = instance . selectFromQuery . limit ( count )
222
+
223
+ return instance
224
+ }
225
+
226
+ take ( count : number ) : this {
227
+ this . selectFromQuery = this . selectFromQuery . limit ( count )
228
+
229
+ return this
230
+ }
231
+
204
232
async pluck < K extends keyof FailedJobModel > ( field : K ) : Promise < FailedJobModel [ K ] [ ] > {
205
233
if ( this . hasSelect ) {
206
234
const model = await this . selectFromQuery . execute ( )
Original file line number Diff line number Diff line change @@ -201,6 +201,34 @@ export class JobModel {
201
201
return model . map ( modelItem => instance . parseResult ( new JobModel ( modelItem ) ) )
202
202
}
203
203
204
+ static skip ( count : number ) : JobModel {
205
+ const instance = new JobModel ( null )
206
+
207
+ instance . selectFromQuery = instance . selectFromQuery . offset ( count )
208
+
209
+ return instance
210
+ }
211
+
212
+ skip ( count : number ) : JobModel {
213
+ this . selectFromQuery = this . selectFromQuery . offset ( count )
214
+
215
+ return this
216
+ }
217
+
218
+ static take ( count : number ) : JobModel {
219
+ const instance = new JobModel ( null )
220
+
221
+ instance . selectFromQuery = instance . selectFromQuery . limit ( count )
222
+
223
+ return instance
224
+ }
225
+
226
+ take ( count : number ) : this {
227
+ this . selectFromQuery = this . selectFromQuery . limit ( count )
228
+
229
+ return this
230
+ }
231
+
204
232
async pluck < K extends keyof JobModel > ( field : K ) : Promise < JobModel [ K ] [ ] > {
205
233
if ( this . hasSelect ) {
206
234
const model = await this . selectFromQuery . execute ( )
Original file line number Diff line number Diff line change @@ -234,6 +234,34 @@ export class PaymentMethodModel {
234
234
return model . map ( modelItem => instance . parseResult ( new PaymentMethodModel ( modelItem ) ) )
235
235
}
236
236
237
+ static skip ( count : number ) : PaymentMethodModel {
238
+ const instance = new PaymentMethodModel ( null )
239
+
240
+ instance . selectFromQuery = instance . selectFromQuery . offset ( count )
241
+
242
+ return instance
243
+ }
244
+
245
+ skip ( count : number ) : PaymentMethodModel {
246
+ this . selectFromQuery = this . selectFromQuery . offset ( count )
247
+
248
+ return this
249
+ }
250
+
251
+ static take ( count : number ) : PaymentMethodModel {
252
+ const instance = new PaymentMethodModel ( null )
253
+
254
+ instance . selectFromQuery = instance . selectFromQuery . limit ( count )
255
+
256
+ return instance
257
+ }
258
+
259
+ take ( count : number ) : this {
260
+ this . selectFromQuery = this . selectFromQuery . limit ( count )
261
+
262
+ return this
263
+ }
264
+
237
265
async pluck < K extends keyof PaymentMethodModel > ( field : K ) : Promise < PaymentMethodModel [ K ] [ ] > {
238
266
if ( this . hasSelect ) {
239
267
const model = await this . selectFromQuery . execute ( )
Original file line number Diff line number Diff line change @@ -205,6 +205,34 @@ export class PostModel {
205
205
return model . map ( modelItem => instance . parseResult ( new PostModel ( modelItem ) ) )
206
206
}
207
207
208
+ static skip ( count : number ) : PostModel {
209
+ const instance = new PostModel ( null )
210
+
211
+ instance . selectFromQuery = instance . selectFromQuery . offset ( count )
212
+
213
+ return instance
214
+ }
215
+
216
+ skip ( count : number ) : PostModel {
217
+ this . selectFromQuery = this . selectFromQuery . offset ( count )
218
+
219
+ return this
220
+ }
221
+
222
+ static take ( count : number ) : PostModel {
223
+ const instance = new PostModel ( null )
224
+
225
+ instance . selectFromQuery = instance . selectFromQuery . limit ( count )
226
+
227
+ return instance
228
+ }
229
+
230
+ take ( count : number ) : this {
231
+ this . selectFromQuery = this . selectFromQuery . limit ( count )
232
+
233
+ return this
234
+ }
235
+
208
236
async pluck < K extends keyof PostModel > ( field : K ) : Promise < PostModel [ K ] [ ] > {
209
237
if ( this . hasSelect ) {
210
238
const model = await this . selectFromQuery . execute ( )
Original file line number Diff line number Diff line change @@ -211,6 +211,34 @@ export class ProductModel {
211
211
return model . map ( modelItem => instance . parseResult ( new ProductModel ( modelItem ) ) )
212
212
}
213
213
214
+ static skip ( count : number ) : ProductModel {
215
+ const instance = new ProductModel ( null )
216
+
217
+ instance . selectFromQuery = instance . selectFromQuery . offset ( count )
218
+
219
+ return instance
220
+ }
221
+
222
+ skip ( count : number ) : ProductModel {
223
+ this . selectFromQuery = this . selectFromQuery . offset ( count )
224
+
225
+ return this
226
+ }
227
+
228
+ static take ( count : number ) : ProductModel {
229
+ const instance = new ProductModel ( null )
230
+
231
+ instance . selectFromQuery = instance . selectFromQuery . limit ( count )
232
+
233
+ return instance
234
+ }
235
+
236
+ take ( count : number ) : this {
237
+ this . selectFromQuery = this . selectFromQuery . limit ( count )
238
+
239
+ return this
240
+ }
241
+
214
242
async pluck < K extends keyof ProductModel > ( field : K ) : Promise < ProductModel [ K ] [ ] > {
215
243
if ( this . hasSelect ) {
216
244
const model = await this . selectFromQuery . execute ( )
Original file line number Diff line number Diff line change @@ -198,6 +198,34 @@ export class ProjectModel {
198
198
return model . map ( modelItem => instance . parseResult ( new ProjectModel ( modelItem ) ) )
199
199
}
200
200
201
+ static skip ( count : number ) : ProjectModel {
202
+ const instance = new ProjectModel ( null )
203
+
204
+ instance . selectFromQuery = instance . selectFromQuery . offset ( count )
205
+
206
+ return instance
207
+ }
208
+
209
+ skip ( count : number ) : ProjectModel {
210
+ this . selectFromQuery = this . selectFromQuery . offset ( count )
211
+
212
+ return this
213
+ }
214
+
215
+ static take ( count : number ) : ProjectModel {
216
+ const instance = new ProjectModel ( null )
217
+
218
+ instance . selectFromQuery = instance . selectFromQuery . limit ( count )
219
+
220
+ return instance
221
+ }
222
+
223
+ take ( count : number ) : this {
224
+ this . selectFromQuery = this . selectFromQuery . limit ( count )
225
+
226
+ return this
227
+ }
228
+
201
229
async pluck < K extends keyof ProjectModel > ( field : K ) : Promise < ProjectModel [ K ] [ ] > {
202
230
if ( this . hasSelect ) {
203
231
const model = await this . selectFromQuery . execute ( )
You can’t perform that action at this time.
0 commit comments