Skip to content

Commit

Permalink
doc: make it clear that the async feature is alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
cljoly committed Dec 10, 2023
1 parent c54951d commit 588e1a7
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
args: --all-features

test_async_tokio_rusqlite:
name: Test feature async-tokio-rusqlite
name: Test feature alpha-async-tokio-rusqlite
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -65,7 +65,7 @@ jobs:
- uses: actions-rs/cargo@v1
with:
command: test
args: --features async-tokio-rusqlite
args: --features alpha-async-tokio-rusqlite

test_from_directory:
name: Test feature from-directory
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Rust 1.70

### New Features

* Support for tokio-rusqlite behind the feature named `alpha-async-tokio-rusqlite`thanks to [@czocher](https://github.com/czocher). See [the example](https://github.com/cljoly/rusqlite_migration/tree/c54951d22691432fbfd511cc68f1c5b8a2306737/examples/async). This feature is alpha, meaning that compatibility in future minor versions is not guaranteed.
* Create migrations from directories holding SQL files thanks to [@czocher](https://github.com/czocher). See [the example](https://github.com/cljoly/rusqlite_migration/tree/af4da527ff75e3b8c089d2300cab7fbe66096411/examples/from-directory).
* Add up/down hooks to run custom Rust code during migrations ([PR](https://github.com/cljoly/rusqlite_migration/pull/28) thanks to [@matze](https://github.com/matze))
* Add foreign_key_check method to migrations ([PR](https://github.com/cljoly/rusqlite_migration/pull/20) thanks to [@Jokler](https://github.com/Jokler))
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ fn migrations_insta_snapshot() {
Rusqlite_migration provides several [Cargo features][cargo_features]. They are:

* `from-directory`: enable loading migrations from *.sql files in a given directory
* `async-tokio-rusqlite`: enable support for async migrations with `tokio-rusqlite`
* `alpha-async-tokio-rusqlite`: enable support for async migrations with `tokio-rusqlite`. As the name implies, there are no API stability guarantees on this feature.

[cargo_features]: https://doc.rust-lang.org/cargo/reference/manifest.html#the-features-section

Expand Down
2 changes: 1 addition & 1 deletion examples/async/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ tokio = { version = "1.25.0", features = ["full"] }

[dependencies.rusqlite_migration]
path = "../../rusqlite_migration"
features = ["async-tokio-rusqlite"]
features = ["alpha-async-tokio-rusqlite"]

[dependencies.rusqlite]
version = "=0.30.0"
Expand Down
2 changes: 1 addition & 1 deletion rusqlite_migration/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ rustdoc-args = ["--cfg", "docsrs"]
[features]
default = []
### Enable support for async migrations with the use of `tokio-rusqlite`
async-tokio-rusqlite = ["dep:tokio-rusqlite", "dep:tokio"]
alpha-async-tokio-rusqlite = ["dep:tokio-rusqlite", "dep:tokio"]

### Enable loading migrations from *.sql files in a given directory
from-directory = ["dep:include_dir"]
Expand Down
6 changes: 3 additions & 3 deletions rusqlite_migration/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub enum Error {
err: rusqlite::Error,
},
/// The underlying SQLite connection is closed
#[cfg(feature = "async-tokio-rusqlite")]
#[cfg(feature = "alpha-async-tokio-rusqlite")]
ConnectionClosed,
/// Error with the specified schema version
SpecifiedSchemaVersion(SchemaVersionError),
Expand Down Expand Up @@ -83,7 +83,7 @@ impl std::error::Error for Error {
Error::MigrationDefinition(e) => Some(e),
Error::ForeignKeyCheck(vec) => Some(vec.get(0)?),
Error::Hook(_) | Error::FileLoad(_) => None,
#[cfg(feature = "async-tokio-rusqlite")]
#[cfg(feature = "alpha-async-tokio-rusqlite")]
Error::ConnectionClosed => None,
Error::Unrecognized(ref e) => Some(&**e),
}
Expand All @@ -99,7 +99,7 @@ impl From<rusqlite::Error> for Error {
}
}

#[cfg(feature = "async-tokio-rusqlite")]
#[cfg(feature = "alpha-async-tokio-rusqlite")]
impl From<tokio_rusqlite::Error> for Error {
fn from(e: tokio_rusqlite::Error) -> Self {
match e {
Expand Down
4 changes: 2 additions & 2 deletions rusqlite_migration/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ mod builder;
#[cfg(feature = "from-directory")]
pub use builder::MigrationsBuilder;

#[cfg(feature = "async-tokio-rusqlite")]
#[cfg(feature = "alpha-async-tokio-rusqlite")]
mod asynch;
mod errors;

#[cfg(test)]
mod tests;

#[cfg(feature = "async-tokio-rusqlite")]
#[cfg(feature = "alpha-async-tokio-rusqlite")]
pub use asynch::AsyncMigrations;
pub use errors::{
Error, ForeignKeyCheckError, HookError, HookResult, MigrationDefinitionError, Result,
Expand Down
2 changes: 1 addition & 1 deletion rusqlite_migration/src/tests/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// For feature "async-tokio-rusqlite"
// For feature "alpha-async-tokio-rusqlite"
mod asynch;

// For feature "from-directory"
Expand Down
2 changes: 1 addition & 1 deletion rusqlite_migration_tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ log = "0.4"

[dependencies.rusqlite_migration]
path = "../rusqlite_migration"
features = ["async-tokio-rusqlite", "from-directory"]
features = ["alpha-async-tokio-rusqlite", "from-directory"]

[dependencies.rusqlite]
version = "0.30.0"
Expand Down

0 comments on commit 588e1a7

Please sign in to comment.