postgresql_extensions/lib.rs
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105
//! # PostgreSQL Extensions
//!
//! [](https://github.com/theseus-rs/postgresql-embedded/actions/workflows/ci.yml)
//! [](https://docs.rs/postgresql_extensions)
//! [](https://codecov.io/gh/theseus-rs/postgresql-embedded)
//! [](https://bencher.dev/perf/theseus-rs-postgresql-embedded)
//! [](https://crates.io/crates/postgresql_extensions)
//! [](https://github.com/theseus-rs/postgresql-embedded/tree/main/postgresql_extensions#license)
//! [](https://semver.org/spec/v2.0.0.html)
//!
//! A configurable library for managing PostgreSQL extensions.
//!
//! ## Examples
//!
//! ### Asynchronous API
//!
//! ```rust
//! use postgresql_extensions::{get_available_extensions, Result};
//!
//! #[tokio::main]
//! async fn main() -> Result<()> {
//! let extensions = get_available_extensions().await?;
//! Ok(())
//! }
//! ```
//!
//! ### Synchronous API
//!
//! ```rust
//! #[cfg(feature = "blocking")] {
//! use postgresql_extensions::Result;
//! use postgresql_extensions::blocking::get_available_extensions;
//!
//! let extensions = get_available_extensions().unwrap();
//! }
//! ```
//!
//! ## Feature flags
//!
//! postgresql_extensions uses [feature flags] to address compile time and binary size
//! uses.
//!
//! The following features are available:
//!
//! | Name | Description | Default? |
//! |--------------|----------------------------|----------|
//! | `blocking` | Enables the blocking API | No |
//! | `native-tls` | Enables native-tls support | Yes |
//! | `rustls-tls` | Enables rustls-tls support | No |
//!
//! ### Repositories
//!
//! | Name | Description | Default? |
//! |----------------|-------------------------------------------|----------|
//! | `portal-corp` | Enables PortalCorp PostgreSQL extensions | Yes |
//! | `steampipe` | Enables Steampipe PostgreSQL extensions | Yes |
//! | `tensor-chord` | Enables TensorChord PostgreSQL extensions | Yes |
//!
//! ## Supported platforms
//!
//! `postgresql_extensions` provides implementations for the following:
//!
//! * [steampipe/repositories](https://github.com/orgs/turbot/repositories)
//! * [tensor-chord/pgvecto.rs](https://github.com/tensor-chord/pgvecto.rs)
//!
//! ## Safety
//!
//! This crate uses `#![forbid(unsafe_code)]` to ensure everything is implemented in 100% safe Rust.
//!
//! ## License
//!
//! Licensed under either of
//!
//! * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or <https://www.apache.org/licenses/LICENSE-2.0>)
//! * MIT license ([LICENSE-MIT](LICENSE-MIT) or <https://opensource.org/licenses/MIT>)
//!
//! at your option.
//!
//! ## Contribution
//!
//! Unless you explicitly state otherwise, any contribution intentionally submitted
//! for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any
//! additional terms or conditions.
#![forbid(unsafe_code)]
#![forbid(clippy::allow_attributes)]
#![deny(clippy::pedantic)]
#![allow(clippy::doc_markdown)]
#![allow(clippy::module_name_repetitions)]
#[cfg(feature = "blocking")]
pub mod blocking;
mod error;
pub mod extensions;
mod matcher;
mod model;
pub mod repository;
pub use error::{Error, Result};
pub use extensions::{get_available_extensions, get_installed_extensions, install, uninstall};
pub use matcher::{matcher, tar_gz_matcher, zip_matcher};
#[cfg(test)]
pub use model::TestSettings;
pub use model::{AvailableExtension, InstalledConfiguration, InstalledExtension};
pub use semver::{Version, VersionReq};