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 a transaction for migrations #43

Merged
merged 3 commits into from
Mar 11, 2025
Merged

Use a transaction for migrations #43

merged 3 commits into from
Mar 11, 2025

Conversation

adam-fowler
Copy link
Member

No description provided.

@Joannis
Copy link
Member

Joannis commented Mar 10, 2025

Test failing to compile

@@ -401,21 +401,21 @@ struct PostgresMigrationRepository: Sendable {

let client: PostgresClient
#if compiler(>=6.0)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can get rid of these version check since the transaction implementation already has checks for isolating stuff?

Copy link
Member Author

Choose a reason for hiding this comment

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

That has to be in each async function call

Copy link
Contributor

Choose a reason for hiding this comment

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

That has to be in each async function call

oh, I see!

try await process(.init(connection: connection, logger: logger))
}
}
#else
func withContext<Value: Sendable>(
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to still wrap this code in a closure? see https://github.com/vapor/postgres-nio/pull/538/files

Copy link
Member Author

Choose a reason for hiding this comment

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

It hides the implementation details a little. I could remove it but not sure it is necessary

@adam-fowler adam-fowler merged commit b2b4398 into main Mar 11, 2025
11 of 12 checks passed
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.

3 participants