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

Add begin_with methods to support database-specific transaction options #3614

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

bonsairobo
Copy link

Fixes #481

@bonsairobo bonsairobo force-pushed the duncan/begin-with branch 2 times, most recently from 2041cdf to 7ab05a6 Compare November 28, 2024 03:23
@bonsairobo

This comment was marked as outdated.

sqlx-core/src/connection.rs Show resolved Hide resolved
sqlx-core/src/connection.rs Outdated Show resolved Hide resolved
sqlx-sqlite/src/connection/mod.rs Outdated Show resolved Hide resolved
sqlx-mysql/src/transaction.rs Outdated Show resolved Hide resolved
tests/sqlite/sqlite.rs Outdated Show resolved Hide resolved
@bonsairobo bonsairobo requested a review from abonander December 3, 2024 03:18
@bonsairobo

This comment was marked as outdated.

@bonsairobo
Copy link
Author

I'm having trouble running the MySQL tests locally. I keep ending up with this error:

error communicating with database: expected to read 4 bytes, got 0 bytes at EOF

Even after I remove the mysql container.

@bonsairobo
Copy link
Author

@abonander All review comments have been addressed. Mind taking another look?

@abonander
Copy link
Collaborator

@bonsairobo can you rebase and fix conflicts?

This patch completes the plumbing of an optional statement from these methods to
`TransactionManager::begin` without any validation of the provided statement.

There is a new `Error::InvalidSavePoint` which is triggered by any attempt to
call `Connection::begin_with` when we are already inside of a transaction.
This makes the new method a non-breaking change.
@bonsairobo bonsairobo force-pushed the duncan/begin-with branch 2 times, most recently from e58d85a to f565ea1 Compare January 26, 2025 08:47
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.

Isolation level support
2 participants