Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

chore: add documentation for bundled feature flag #192

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 17, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions 24 postgresql_embedded/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,30 @@ The following features are available:
| `tokio` | Enables using tokio for async | No |
| `zonky` | Enables zonky PostgreSQL binaries | No |

## Bundling PostgreSQL

To bundle PostgreSQL with your application, you can enable the `bundled` feature. This will download the PostgreSQL
archive at compile time and include it in your binary. You should specify the version of PostgreSQL to bundle by
setting the environment variable `POSTGRESQL_VERSION` to a specific version, e.g. `=17.2.0`. In order to use the bundled
PostgreSQL, you will also need to set an explicit matching version at runtime in `Settings`:

```rust
use postgresql_embedded::{Result, Settings, VersionReq};

#[tokio::main]
async fn main() -> Result<()> {
let settings = Settings {
version: VersionReq::from_str("=17.2.0")?,
..Default::default()
};
Ok(())
}
```

The PostgreSQL binaries can also be obtained from a different GitHub source by setting the `POSTGRESQL_RELEASES_URL`
environment variable. The repository must contain the releases with archives in same structure as
[theseus-rs/postgresql_binaries](https://github.com/theseus-rs/postgresql-binaries).

## Safety

This crate uses `#![forbid(unsafe_code)]` to ensure everything is implemented in 100% safe Rust.
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.