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