Skip to content

Commit a903a43

Browse files
chore: wip
1 parent f05b4b4 commit a903a43

File tree

18 files changed

+54
-37
lines changed

18 files changed

+54
-37
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,10 +1084,10 @@ export async function generateModelString(
10841084
10851085
return models.map((modelItem: ${modelName}Model) => instance.parseResult(new ${modelName}Model(modelItem)))
10861086
}
1087-
1088-
//TODO: fix
10891087
skip(count: number): ${modelName}Model {
1090-
return ${modelName}Model.skip(count)
1088+
this.selectFromQuery = this.selectFromQuery.offset(count)
1089+
1090+
return this
10911091
}
10921092
10931093
static skip(count: number): ${modelName}Model {

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,9 +318,10 @@ export class AccessTokenModel {
318318
return models.map((modelItem: AccessTokenModel) => instance.parseResult(new AccessTokenModel(modelItem)))
319319
}
320320

321-
// TODO: fix
322321
skip(count: number): AccessTokenModel {
323-
return AccessTokenModel.skip(count)
322+
this.selectFromQuery = this.selectFromQuery.offset(count)
323+
324+
return this
324325
}
325326

326327
static skip(count: number): AccessTokenModel {

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,9 +341,10 @@ export class ActivityModel {
341341
return models.map((modelItem: ActivityModel) => instance.parseResult(new ActivityModel(modelItem)))
342342
}
343343

344-
// TODO: fix
345344
skip(count: number): ActivityModel {
346-
return ActivityModel.skip(count)
345+
this.selectFromQuery = this.selectFromQuery.offset(count)
346+
347+
return this
347348
}
348349

349350
static skip(count: number): ActivityModel {

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,9 +355,10 @@ export class DeploymentModel {
355355
return models.map((modelItem: DeploymentModel) => instance.parseResult(new DeploymentModel(modelItem)))
356356
}
357357

358-
// TODO: fix
359358
skip(count: number): DeploymentModel {
360-
return DeploymentModel.skip(count)
359+
this.selectFromQuery = this.selectFromQuery.offset(count)
360+
361+
return this
361362
}
362363

363364
static skip(count: number): DeploymentModel {

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,9 +314,10 @@ export class ErrorModel {
314314
return models.map((modelItem: ErrorModel) => instance.parseResult(new ErrorModel(modelItem)))
315315
}
316316

317-
// TODO: fix
318317
skip(count: number): ErrorModel {
319-
return ErrorModel.skip(count)
318+
this.selectFromQuery = this.selectFromQuery.offset(count)
319+
320+
return this
320321
}
321322

322323
static skip(count: number): ErrorModel {

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,9 +314,10 @@ export class FailedJobModel {
314314
return models.map((modelItem: FailedJobModel) => instance.parseResult(new FailedJobModel(modelItem)))
315315
}
316316

317-
// TODO: fix
318317
skip(count: number): FailedJobModel {
319-
return FailedJobModel.skip(count)
318+
this.selectFromQuery = this.selectFromQuery.offset(count)
319+
320+
return this
320321
}
321322

322323
static skip(count: number): FailedJobModel {

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,9 +314,10 @@ export class JobModel {
314314
return models.map((modelItem: JobModel) => instance.parseResult(new JobModel(modelItem)))
315315
}
316316

317-
// TODO: fix
318317
skip(count: number): JobModel {
319-
return JobModel.skip(count)
318+
this.selectFromQuery = this.selectFromQuery.offset(count)
319+
320+
return this
320321
}
321322

322323
static skip(count: number): JobModel {

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,9 +364,10 @@ export class PaymentMethodModel {
364364
return models.map((modelItem: PaymentMethodModel) => instance.parseResult(new PaymentMethodModel(modelItem)))
365365
}
366366

367-
// TODO: fix
368367
skip(count: number): PaymentMethodModel {
369-
return PaymentMethodModel.skip(count)
368+
this.selectFromQuery = this.selectFromQuery.offset(count)
369+
370+
return this
370371
}
371372

372373
static skip(count: number): PaymentMethodModel {

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,9 +300,10 @@ export class PostModel {
300300
return models.map((modelItem: PostModel) => instance.parseResult(new PostModel(modelItem)))
301301
}
302302

303-
// TODO: fix
304303
skip(count: number): PostModel {
305-
return PostModel.skip(count)
304+
this.selectFromQuery = this.selectFromQuery.offset(count)
305+
306+
return this
306307
}
307308

308309
static skip(count: number): PostModel {

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,9 +342,10 @@ export class ProductModel {
342342
return models.map((modelItem: ProductModel) => instance.parseResult(new ProductModel(modelItem)))
343343
}
344344

345-
// TODO: fix
346345
skip(count: number): ProductModel {
347-
return ProductModel.skip(count)
346+
this.selectFromQuery = this.selectFromQuery.offset(count)
347+
348+
return this
348349
}
349350

350351
static skip(count: number): ProductModel {

0 commit comments

Comments
 (0)