Skip to content

Commit

Permalink
bug: update postgresql_embedded to enable "bundled" as a default feature
Browse files Browse the repository at this point in the history
  • Loading branch information
brianheineman committed Feb 5, 2024
1 parent fcd7d85 commit 677eab5
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 8 additions & 5 deletions postgresql_archive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
//! }
//! }
//! ```
//!
Expand Down
2 changes: 1 addition & 1 deletion postgresql_embedded/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ tokio = { workspace = true, optional = true }
tokio = { workspace = true }

[features]
default = []
default = ["bundled"]
blocking = ["tokio"]
bundled = []
tokio = ["dep:tokio"]
19 changes: 11 additions & 8 deletions postgresql_embedded/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
//! }
//! }
//! ```
//!
Expand Down

0 comments on commit 677eab5

Please sign in to comment.