From 677eab541dfcbdfd5ece6f7e24fcd0c29b30fadb Mon Sep 17 00:00:00 2001 From: brianheineman Date: Mon, 5 Feb 2024 14:24:24 -0700 Subject: [PATCH] bug: update postgresql_embedded to enable "bundled" as a default feature --- .github/workflows/build.yml | 4 ++-- postgresql_archive/src/lib.rs | 13 ++++++++----- postgresql_embedded/Cargo.toml | 2 +- postgresql_embedded/src/lib.rs | 19 +++++++++++-------- 4 files changed, 22 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0bac458..e471764 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -47,9 +47,9 @@ jobs: - name: Tests run: | - cargo test --package postgresql_archive + cargo test --package postgresql_archive --no-default-features cargo test --package postgresql_archive --all-features - cargo test --package postgresql_embedded + cargo test --package postgresql_embedded --no-default-features cargo test --package postgresql_embedded --features blocking cargo test --package postgresql_embedded --features bundled cargo test --package postgresql_embedded --features tokio diff --git a/postgresql_archive/src/lib.rs b/postgresql_archive/src/lib.rs index e49dbd6..1d35ac6 100644 --- a/postgresql_archive/src/lib.rs +++ b/postgresql_archive/src/lib.rs @@ -35,14 +35,17 @@ //! //! ### Synchronous API //! ```rust -//! #[cfg(feature = "blocking")] -//! { //! use postgresql_archive::LATEST; +//! #[cfg(feature = "blocking")] //! use postgresql_archive::blocking::{extract, get_archive}; //! -//! let (archive_version, archive, hash) = get_archive(&LATEST).unwrap(); -//! let out_dir = std::env::temp_dir(); -//! let result = extract(&archive, &out_dir); +//! fn main() { +//! #[cfg(feature = "blocking")] +//! { +//! let (archive_version, archive, hash) = get_archive(&LATEST).unwrap(); +//! let out_dir = std::env::temp_dir(); +//! let result = extract(&archive, &out_dir); +//! } //! } //! ``` //! diff --git a/postgresql_embedded/Cargo.toml b/postgresql_embedded/Cargo.toml index 75851ec..2fd4921 100644 --- a/postgresql_embedded/Cargo.toml +++ b/postgresql_embedded/Cargo.toml @@ -32,7 +32,7 @@ tokio = { workspace = true, optional = true } tokio = { workspace = true } [features] -default = [] +default = ["bundled"] blocking = ["tokio"] bundled = [] tokio = ["dep:tokio"] diff --git a/postgresql_embedded/src/lib.rs b/postgresql_embedded/src/lib.rs index 8071f76..fd7509d 100644 --- a/postgresql_embedded/src/lib.rs +++ b/postgresql_embedded/src/lib.rs @@ -41,16 +41,19 @@ //! ### Synchronous API //! ```rust //! #[cfg(feature = "blocking")] -//! { //! use postgresql_embedded::blocking::PostgreSQL; //! -//! let mut postgresql = PostgreSQL::default(); -//! postgresql.setup().unwrap(); -//! postgresql.start().unwrap(); -//! postgresql.create_database("database_name").unwrap(); -//! postgresql.database_exists("database_name").unwrap(); -//! postgresql.drop_database("database_name").unwrap(); -//! postgresql.stop().unwrap(); +//! fn main() { +//! #[cfg(feature = "blocking")] +//! { +//! let mut postgresql = PostgreSQL::default(); +//! postgresql.setup().unwrap(); +//! postgresql.start().unwrap(); +//! postgresql.create_database("database_name").unwrap(); +//! postgresql.database_exists("database_name").unwrap(); +//! postgresql.drop_database("database_name").unwrap(); +//! postgresql.stop().unwrap(); +//! } //! } //! ``` //!