Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop sqlc overrides for JobState #229

Merged
merged 1 commit into from
Feb 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions riverdriver/riverdatabasesql/internal/dbsqlc/models.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 0 additions & 7 deletions riverdriver/riverdatabasesql/internal/dbsqlc/sqlc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,6 @@ sql:

rename:
river_job_state: "JobState"
river_job_state_available: "JobStateAvailable"
river_job_state_cancelled: "JobStateCancelled"
river_job_state_completed: "JobStateCompleted"
river_job_state_discarded: "JobStateDiscarded"
river_job_state_retryable: "JobStateRetryable"
river_job_state_running: "JobStateRunning"
river_job_state_scheduled: "JobStateScheduled"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one less thing to have to fix when I get that pending state added soon.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, totally. Should keep future changes of that sort a bit easier.

ttl: "TTL"

overrides:
Expand Down
42 changes: 21 additions & 21 deletions riverdriver/riverpgxv5/internal/dbsqlc/models.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions riverdriver/riverpgxv5/internal/dbsqlc/river_job.sql.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 0 additions & 8 deletions riverdriver/riverpgxv5/internal/dbsqlc/sqlc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,6 @@ sql:
emit_result_struct_pointers: true

rename:
river_job_state: "JobState"
river_job_state_available: "JobStateAvailable"
river_job_state_cancelled: "JobStateCancelled"
river_job_state_completed: "JobStateCompleted"
river_job_state_discarded: "JobStateDiscarded"
river_job_state_retryable: "JobStateRetryable"
river_job_state_running: "JobStateRunning"
river_job_state_scheduled: "JobStateScheduled"
ttl: "TTL"

overrides:
Expand Down
10 changes: 5 additions & 5 deletions riverdriver/riverpgxv5/river_pgx_v5_driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func (e *Executor) JobInsertFast(ctx context.Context, params *riverdriver.JobIns
Priority: int16(min(params.Priority, math.MaxInt16)),
Queue: params.Queue,
ScheduledAt: params.ScheduledAt,
State: dbsqlc.JobState(params.State),
State: dbsqlc.RiverJobState(params.State),
Tags: params.Tags,
})
if err != nil {
Expand Down Expand Up @@ -193,7 +193,7 @@ func (e *Executor) JobInsertFastMany(ctx context.Context, params []*riverdriver.
Priority: int16(min(params.Priority, math.MaxInt16)),
Queue: params.Queue,
ScheduledAt: scheduledAt,
State: dbsqlc.JobState(params.State),
State: dbsqlc.RiverJobState(params.State),
Tags: tags,
}
}
Expand All @@ -220,7 +220,7 @@ func (e *Executor) JobInsertFull(ctx context.Context, params *riverdriver.JobIns
Priority: int16(min(params.Priority, math.MaxInt16)),
Queue: params.Queue,
ScheduledAt: params.ScheduledAt,
State: dbsqlc.JobState(params.State),
State: dbsqlc.RiverJobState(params.State),
Tags: params.Tags,
})
if err != nil {
Expand Down Expand Up @@ -310,7 +310,7 @@ func (e *Executor) JobSetStateIfRunning(ctx context.Context, params *riverdriver
MaxAttempts: maxAttempts,
ScheduledAtDoUpdate: params.ScheduledAt != nil,
ScheduledAt: params.ScheduledAt,
State: dbsqlc.JobState(params.State),
State: dbsqlc.RiverJobState(params.State),
})
if err != nil {
return nil, interpretError(err)
Expand All @@ -330,7 +330,7 @@ func (e *Executor) JobUpdate(ctx context.Context, params *riverdriver.JobUpdateP
FinalizedAtDoUpdate: params.FinalizedAtDoUpdate,
FinalizedAt: params.FinalizedAt,
StateDoUpdate: params.StateDoUpdate,
State: dbsqlc.JobState(params.State),
State: dbsqlc.RiverJobState(params.State),
})
if err != nil {
return nil, interpretError(err)
Expand Down
Loading