Release notes for the rusqlite_migration library.
Version 2.0.0 Alpha 1
Breaking changes
Remove the alpha-async-tokio-rusqlite
Feature
As the name of the feature suggest, we have had experimental support for async using tokio for a while now. Supporting that feature has been quite a big burden, introducing some duplicated code in the AsyncMigrations
struct in particular, as well as a whole set of very similar tests. Plus the benefit of async is limited here, because everything gets executed in a blocking fashion in sqlite anyway.
It turns out that we don’t need the async support in rusqlite_migration for folks to use async libraries. For instance, with tokio-rusqlite, you can define migrations like in the sync context and run:
async_conn
.call_unwrap(|conn| MIGRATIONS.to_latest(conn))
.await?;
See the updated async example for details, in particular why it’s fine to call a method with unwrap in its name.
Make the Builder Finalizer
Method Not Generic
On a related note, now that we have removed the AsyncMigrations
(see the section right above) struct, we only have Migrations
so there is no need for the MigrationsBuilder.finalize
method to be generic. Thus we removed the generic argument. To update your code, you can just do this:
- .finalize::<Migrations>());
+ .finalize());
Remove Migrations::new_iter
This function has been deprecated for a while now, remove it as a part of the major version bump. You can use the standard FromIter
trait implementation instead.
Behavior Change
- When the user version field is altered by other code in your application, we are now returning an explicit error (
Error::InvalidUserVersion
) when this can be detected. Previously, the library would silently misbehave.
Dependencies
Rusqlite was updated from 0.32.1 to 0.34.0. Please see the release notes for 0.34.0 and the release notes for 0.33.0. Tokio Rusqlite was removed as a dependency.
Features
Migrations::new
is nowconst
Minimum Rust Version
Rust 1.84.
Moving forward, we expect to keep this aligned with rusqlite itself, now that it has a policy (introduced in october 2024).
Version 1.3.1
The only change is a fix to the deps.rs badge in the documentation.
Version 1.3.0
The code of this version is identical to Version 1.3.0 Beta 1
Rusqlite was updated from 0.31.0 to 0.32.1. Please see the release notes for 0.32.0 and for 0.32.1. Tokio Rusqlite was updated from 0.5.1 to 0.6.0. Please see the release notes.
Minimum Rust Version
Rust 1.77
Documentation
Various documentation improvements and clarification. In particular, call out that if a rusqlite error is encountered during a migration, the next migrations in the list are not applied.
Other
- Apply minor or patch updates to the dependencies
- Update development dependencies
- Make CI testing more reproducible by forcing the use of Cargo.lock
Version 1.3.0 Beta 1
This reintroduces the async features temporarily removed from Version 1.3.0 Alpha-Without-Tokio 1
Rusqlite was updated from 0.31.0 to 0.32.1. Please see the release notes for 0.32.0 and for 0.32.1. Tokio Rusqlite was updated from 0.5.1 to 0.6.0. Please see the release notes.
Minimum Rust Version
Rust 1.77
Documentation
Various documentation improvements and clarification. In particular, call out that if a rusqlite error is encountered during a migration, the next migrations in the list are not applied.
Other
- Apply minor or patch updates to the dependencies
- Update development dependencies
- Make CI testing more reproducible by forcing the use of Cargo.lock
Version 1.3.0 Alpha-Without-Tokio 1
Major Changes
This is an alpha version to start integrating rusqlite 0.32.1. Unfortunately, at this time, tokio-rusqlite is did not update to rusqlite 0.32.1. So we are temporarily removing the async features, while we figure out a way to bring them back. To be clear, we intend to support the async features going forward, this is a temporary change in a specifically tagged version.
Rusqlite was updated from 0.31.0 to 0.32.1. Please see the release notes for 0.32.0 and for 0.32.1
Minimum Rust Version
Rust 1.77
Documentation
Various documentation improvements and clarification. In particular, call out that if a rusqlite error is encountered during a migration, the next migrations in the list are not applied.
Other
- Apply minor or patch updates to the dependencies
- Update development dependencies
- Make CI testing more reproducible by forcing the use of Cargo.lock
Version 1.2.0
Same code as version 1.2.0-beta.1
Documentation
- Improved the badges a little bit
Version 1.2.0 Beta 1
Small release, mainly to update dependencies.
Minimum Rust Version
Now using edition 2021, but the minimum rust version is still 1.70
New Features
No new features.
Other
- Update rusqlite to 0.31
- Update various development dependencies
- Improve CI build time
- Impove documentation
- Fix some broken examples
See also
Rusqlite was updated from 0.30 to 0.31. Please see its release notes
Version 1.1.0
Same code as version 1.1.0-beta.1
Minimum Rust Version
Rust 1.70
New Features
- Support for tokio-rusqlite behind the feature named
alpha-async-tokio-rusqlite
thanks to @czocher. See the example. This feature is alpha, meaning that compatibility in future minor versions is not guaranteed. - Create migrations from directories holding SQL files thanks to @czocher. See the example.
- Add up/down hooks to run custom Rust code during migrations (PR thanks to @matze)
- Add foreign_key_check method to migrations (PR thanks to @Jokler)
- Make
Migration
functions const (PR thanks to @fkaa) - Make
Migrations
serializable (using the Debug serializer) with insta.
Depreciation
- Mark
Migrations::from_iter
as deprecated
Other
- Documentation improvements
- Repository metadata improvements
- Code quality improvements
- Introduce cargo mutants & fix bugs found
- Clippy warning fixes and other linter improvements
- Report on test coverage & improve test coverage
- Add benchmarks
- Made errors returned more precise
- Updated dependencies
See also
Rusqlite was updated from 0.29.0 to 0.30.0. Please see its release notes
Version 1.1.0 Beta 1
⚠️ The APIs exposed in this version may be unstable.
Summing up all the changes from the previous Alpha versions.
Minimum Rust Version
Rust 1.70
New Features
- Support for tokio-rusqlite behind the feature named
alpha-async-tokio-rusqlite
thanks to @czocher. See the example. This feature is alpha, meaning that compatibility in future minor versions is not guaranteed. - Create migrations from directories holding SQL files thanks to @czocher. See the example.
- Add up/down hooks to run custom Rust code during migrations (PR thanks to @matze)
- Add foreign_key_check method to migrations (PR thanks to @Jokler)
- Make
Migration
functions const (PR thanks to @fkaa) - Make
Migrations
serializable (using the Debug serializer) with insta.
Depreciation
- Mark
Migrations::from_iter
as deprecated
Other
- Documentation improvements
- Repository metadata improvements
- Code quality improvements
- Introduce cargo mutants & fix bugs found
- Clippy warning fixes and other linter improvements
- Report on test coverage & improve test coverage
- Add benchmarks
- Made errors returned more precise
- Updated dependencies
See also
Rusqlite was updated from 0.29.0 to 0.30.0. Please see its release notes
Version 1.1.0 Alpha 2
⚠️ The APIs exposed in this version may be unstable.
Minimum Rust Version
Rust 1.64
New Features
- Create migrations from directories holding SQL files. See the example.
Depreciation
- Mark
Migrations::from_iter
as deprecated
Other
- Documentation improvements
- Code quality improvements
- Introduce cargo mutants & fix bugs found
- Clippy warning fixes
- Report on test coverage & improve test coverage
- Add benchmarks
- Made errors returned more precise
- Update dependencies
Version 1.1.0 Alpha 1
⚠️ The APIs exposed in this version may be unstable.
Minimum Rust Version
Rust 1.61
New Features
- Add up/down hooks to run custom Rust code during migrations (PR thanks to @matze)
- The purpose of this release is to get feedback on the new API. Please feel free to comment on this discussion!
- Add foreign_key_check method to migrations (PR thanks to @Jokler)
- Please beware of the follow up work needed on this
- Make
Migration
functions const (PR thanks to @fkaa)
Other
- CI improvements
- Linter improvements
- Repository metadata improvements
- Documentation improvements
- Dev dependencies update (not dependencies of the library when used in another crate)
Version 1.0.2
Bug fix
- fix: adapt to rusqlite 0.29 and tighten dependency requirements for rusqlite (see this discussion)
Version 1.0.1
Bug Fix
- fix: error instead of panicking on higher migration level (see commit ad57d92d1677420eb81c4e25635be1884f9b7ce7)
Other
- Documentation improvements
Version 1.0.0
Breaking changes
- Remove deprecated symbols (
Migrations.latest
,SchemaVersionError::MigrateToLowerNotSupported
)
Other
- Documentation improvements
Version 0.5.1
Potentially Breaking Changes
- Update the
rusqlite
crate (to protect agaisnt RUSTSEC-2020-0014)
Other
- Improve the documentation
Version 0.5.0
- Update the
env_logger
dependency - Improve the documentation
Version 0.4.1 / 0.4.2
- Update documentation
Version 0.4.0
New features
- Add downward migrations, i.e. migrations to go to past schema version of the database. Thanks @MightyPork!
- Unsafe code is now forbidden.
Breaking changes
- Rename
latest
toto_latest
. The old symbol is deprecated and will be removed eventually. - An error is now returned when a migration is attempted while no migrations exist.
Other
- Improve general rust API documentation.
- Generate parts of the readme based on rust comments, for increased consistency with the docs.rs content.
- Various refactoring and clean-ups.
Version 0.3.1
Fix in readme, for crates.io
Version 0.3
New features
- Multi line sql statements like:
are now fully supportedM::up(r#" CREATE TABLE t1(a, b); CREATE TABLE t2(a, b); "#)
Other
- Various doc & CI improvements
- Fix a case of failure with silent errors.