Atomic migrations by default in SQLite
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 9.9k
- Forks
- 734
- Avg merge
- 6h 36m
- Merged PRs (30d)
- 8
Description
Motivation
https://github.com/SeaQL/sea-orm/pull/2980 added support for running migrations atomically inside of a transaction, but only enabled it for PostgreSQL. SQLite can also run DDL statements inside of transactions and roll them back, so atomic migrations should be used for it as well by default.
Proposed Solutions
Extend the check for PostgreSQL to check for SQLite as well.
Additional Information
The PR added a way to force using a transaction using fn use_transaction(&self) -> Option<bool> { Some(true) } but it's boilerplate-y.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate the PostgreSQL transaction eligibility check introduced by PR 2980 and inspect the surrounding migration logic and SQLite tests. Extend the default behavior to SQLite, then verify that SQLite migrations run atomically and roll back on failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust, sqlite
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 72/100