Refactor: transition from ex-GORM structs to sqlc structs #104343

Open
opened 2024-11-11 19:38:53 +01:00 by Sybren A. Stüvel · 0 comments

Replace old used-to-be-GORM datastructures (#104305) with sqlc-generated structs.

This also makes it possible to use more specific structs that are more taylored to the specific queries, increasing efficiency.

Functional changes are kept to a minimum, as the API still serves the same data. Sometimes it might work better to change the API a bit; those changes will be listed below:

  • nothing yet

To convert:

  • internal/manager/persistence/db.go
  • internal/manager/persistence/db_migration.go
  • internal/manager/persistence/errors.go
  • internal/manager/persistence/integrity.go
  • internal/manager/persistence/jobs.go
  • internal/manager/persistence/jobs_blocklist.go
  • internal/manager/persistence/jobs_query.go
  • internal/manager/persistence/last_rendered.go
  • internal/manager/persistence/logger.go
  • internal/manager/persistence/sqlite_busy.go
  • internal/manager/persistence/task_scheduler.go
  • internal/manager/persistence/test_support.go
  • internal/manager/persistence/time_of_day.go
  • internal/manager/persistence/timeout.go
  • internal/manager/persistence/worker_sleep_schedule.go
  • internal/manager/persistence/worker_tag.go
  • internal/manager/persistence/workers.go
Replace old used-to-be-GORM datastructures (#104305) with sqlc-generated structs. This also makes it possible to use more specific structs that are more taylored to the specific queries, increasing efficiency. Functional changes are kept to a minimum, as the API still serves the same data. Sometimes it might work better to change the API a bit; those changes will be listed below: - nothing yet To convert: - [x] internal/manager/persistence/db.go - [x] internal/manager/persistence/db_migration.go - [x] internal/manager/persistence/errors.go - [x] internal/manager/persistence/integrity.go - [ ] internal/manager/persistence/jobs.go - [x] internal/manager/persistence/jobs_blocklist.go - [ ] internal/manager/persistence/jobs_query.go - [x] internal/manager/persistence/last_rendered.go - [x] internal/manager/persistence/logger.go - [x] internal/manager/persistence/sqlite_busy.go - [ ] internal/manager/persistence/task_scheduler.go - [ ] internal/manager/persistence/test_support.go - [x] internal/manager/persistence/time_of_day.go - [ ] internal/manager/persistence/timeout.go - [x] internal/manager/persistence/worker_sleep_schedule.go - [x] internal/manager/persistence/worker_tag.go - [x] internal/manager/persistence/workers.go
Sybren A. Stüvel added the
Type
To Do
label 2024-11-11 19:38:53 +01:00
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: studio/flamenco#104343
No description provided.