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

Use migration system for JobQueue and Persist frameworks #8

Merged
merged 11 commits into from
Mar 7, 2024

Conversation

adam-fowler
Copy link
Member

@adam-fowler adam-fowler commented Mar 6, 2024

Also HBMigrations.revert() no longer sets the migrations to be complete.

@adam-fowler adam-fowler requested a review from Joannis March 6, 2024 14:08
Copy link
Member

@Joannis Joannis left a comment

Choose a reason for hiding this comment

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

Just worried about namespace clashing


extension HBMigrationGroup {
/// JobQueue migration group
public static var jobQueue: Self { .init("_hb_jobqueue") }
Copy link
Member

Choose a reason for hiding this comment

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

Isn't this better off as such:

Suggested change
public static var jobQueue: Self { .init("_hb_jobqueue") }
public static var jobQueue: Self { .init("_hb_pg_jobqueue") }

@@ -180,7 +166,7 @@ public final class HBPostgresQueue: HBJobQueueDriver {
}
// select job from job table
let stream2 = try await connection.query(
"SELECT job FROM \(unescaped: self.configuration.jobTable) WHERE id = \(jobId)",
"SELECT job FROM _hb_jobs WHERE id = \(jobId)",
Copy link
Member

Choose a reason for hiding this comment

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

These tables should probably be namespaced to pg right?


extension HBMigrationGroup {
/// Persist driver migration group
public static var persist: Self { .init("_hb_persist") }
Copy link
Member

Choose a reason for hiding this comment

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

Likewise

Suggested change
public static var persist: Self { .init("_hb_persist") }
public static var persist: Self { .init("_hb_pg_persist") }

@adam-fowler adam-fowler merged commit 8d97094 into main Mar 7, 2024
6 checks passed
@adam-fowler adam-fowler deleted the jobqueue-persist-migrations branch March 14, 2024 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants