Version 2.0.0 #261
cljoly
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Version 2.0.0
Breaking changes
Remove the
alpha-async-tokio-rusqlite
FeatureAs 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:
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 GenericOn a related note, now that we have removed the
AsyncMigrations
(see the section right above) struct, we only haveMigrations
so there is no need for theMigrationsBuilder.finalize
method to be generic. Thus we removed the generic argument. To update your code, you can just do this: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
Error::InvalidUserVersion
) when this can be detected. Previously, the library would silently misbehave.Features
Migrations::from_slice
constructor, which isconst
and takes a slice, so that it can be constructed in global constant, without usingLazyLock
or similar. Internally, this is possible because we now use aCow
structure to hold migrations.Migrations::pending_migrations
which returns the number of migrations that would be applied. This is mostly useful to take a backup of the database prior to applying migrations (and do nothing if no migrations will be applied).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.
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).
What's Changed
Migrations::new_iter
by @cljoly in refactor!: removeMigrations::new_iter
#235Cow
instead ofVec
by @cljoly in refactor: Keep migrations inCow
instead ofVec
#252Migrations::from_slice
documentation by @MonterraByte in docs: improveMigrations::from_slice
documentation #253New Contributors
Full Changelog: v1.3.1...v2.0.0
This discussion was created from the release Version 2.0.0.
Beta Was this translation helpful? Give feedback.
All reactions