SeaQL / SeaQL/sea-orm

Upcoming SQLx Breakage: `TransactionManager` trait reexport is being deleted in 0.9.0

Open
#2,600 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
9.9k
Forks
735
Avg merge
6h 36m
Merged PRs (30d)
8

Description

This is a friendly warning that the TransactionManager trait currently being used by this crate will no longer be re-exported by SQLx in the 0.9.0 release.

Reposting the discussion in https://github.com/SeaQL/sea-orm/pull/2562#issuecomment-2808177497 for visibility since it was never acknowledged by a maintainer.

I see why it's necessary: you're using your own RAII wrapper that's not compatible with sqlx::Transaction. I can see the motivation for that.

The issue is that TransactionManager is an implementation detail that needs to remain flexible so we can do things like add begin_with backwards-compatibly. That's why it's a #[doc(hidden)] trait.

We need to figure out a long-term solution here:

  • You could use the trait from sqlx-core with a pinned version, but then you have to cut a release every time SQLx does.

  • You could implement your own transaction handling and execute BEGIN, COMMIT and ROLLBACK statements directly. This offers SeaORM the most potential flexibility. At the end of the day, it's not that complicated. You could copy the routines that SQLx uses if you want.

  • We could design a non-RAII transaction begin/end API for SQLx. My main concern with this is that the RAII-based API should still be the preferred method for 99% of use-cases, so the design should make that obvious.

I'm also wondering if it's worth just merging TransactionManager into the Connection trait since that's probably where those methods belong.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the linked SeaORM pull request discussion and the SQLx TransactionManager and Connection APIs. Determine which long-term transaction approach the project will adopt; completion depends on an agreed design and corresponding compatibility work, which this issue does not yet specify.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.