diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml deleted file mode 100644 index 3d0ce13..0000000 --- a/.github/workflows/benchmarks.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: Benchmarks - -on: - push: - branches: - - main - pull_request: - types: [ opened, reopened, synchronize ] - -permissions: - contents: read - -jobs: - benchmark: - name: Run Benchmarks - runs-on: ubuntu-latest - permissions: - pull-requests: write - steps: - - name: Checkout source code - uses: actions/checkout@v7 - - - name: Install Rust - run: rustup toolchain install --no-self-update --component llvm-tools-preview - - - name: Install benchmarking tools - uses: bencherdev/bencher@main - - - name: Run benchmarks - if: ${{ github.event_name == 'pull_request' }} - env: - BENCHER_API_TOKEN: ${{ secrets.BENCHER_API_TOKEN }} - BENCHER_PROJECT: theseus-rs-postgresql-embedded - BENCHER_ADAPTER: rust_criterion - run: | - bencher run \ - --branch $GITHUB_HEAD_REF \ - --ci-number "${{ github.event.number }}" \ - --github-actions "${{ secrets.GITHUB_TOKEN }}" \ - --err \ - "cargo bench --features blocking" - - - name: Run benchmarks - if: ${{ github.event_name != 'pull_request' }} - env: - BENCHER_API_TOKEN: ${{ secrets.BENCHER_API_TOKEN }} - BENCHER_PROJECT: theseus-rs-postgresql-embedded - BENCHER_ADAPTER: rust_criterion - run: | - bencher run "cargo bench --features blocking" diff --git a/.github/workflows/pr-benchmarks.yml b/.github/workflows/pr-benchmarks.yml deleted file mode 100644 index dff863a..0000000 --- a/.github/workflows/pr-benchmarks.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: Benchmarks - -on: - pull_request: - types: [ opened, reopened, synchronize ] - -permissions: - contents: read - -jobs: - benchmark: - name: Run Benchmarks - runs-on: ubuntu-latest - permissions: - pull-requests: write - steps: - - name: Checkout source code - uses: actions/checkout@v7 - - - name: Install Rust - run: rustup toolchain install --no-self-update --component llvm-tools-preview - - - name: Install benchmarking tools - uses: bencherdev/bencher@main - - - name: Run benchmarks - env: - BENCHER_API_TOKEN: ${{ secrets.BENCHER_API_TOKEN }} - BENCHER_PROJECT: theseus-rs-postgresql-embedded - BENCHER_ADAPTER: rust_criterion - run: | - bencher run \ - --branch $GITHUB_HEAD_REF \ - --ci-number "${{ github.event.number }}" \ - --github-actions "${{ secrets.GITHUB_TOKEN }}" \ - --err \ - "cargo bench --features blocking" diff --git a/README.md b/README.md index e02dad8..4cf9be4 100644 --- a/README.md +++ b/README.md @@ -5,19 +5,17 @@ [![ci](https://github.com/theseus-rs/postgresql-embedded/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/theseus-rs/postgresql-embedded/actions/workflows/ci.yml) [![Documentation](https://docs.rs/postgresql_embedded/badge.svg)](https://docs.rs/postgresql_embedded) [![Code Coverage](https://codecov.io/gh/theseus-rs/postgresql-embedded/branch/main/graph/badge.svg)](https://codecov.io/gh/theseus-rs/postgresql-embedded) -[![Benchmarks](https://img.shields.io/badge/%F0%9F%90%B0_bencher-enabled-6ec241)](https://bencher.dev/perf/theseus-rs-postgresql-embedded) [![Latest version](https://img.shields.io/crates/v/postgresql_embedded.svg)](https://crates.io/crates/postgresql_embedded) [![License](https://img.shields.io/crates/l/postgresql_embedded)](https://github.com/theseus-rs/postgresql-embedded#license) [![Semantic Versioning](https://img.shields.io/badge/%E2%9A%99%EF%B8%8F_SemVer-2.0.0-blue)](https://semver.org/spec/v2.0.0.html) -Install and run a PostgreSQL database locally on Linux, MacOS or Windows. PostgreSQL can be -bundled with your application, or downloaded on demand. +Install and run a PostgreSQL database locally on Linux, MacOS or Windows. PostgreSQL can be bundled with your +application, or downloaded on demand. -This library provides an embedded-like experience for PostgreSQL similar to what you would have with -SQLite. This is accomplished by downloading and installing PostgreSQL during runtime. There is -also a "bundled" feature that when enabled, will download the PostgreSQL installation archive at -compile time, include it in your binary and install from the binary version at runtime. -In either case, PostgreSQL will run in a separate process space. +This library provides an embedded-like experience for PostgreSQL similar to what you would have with SQLite. This is +accomplished by downloading and installing PostgreSQL during runtime. There is also a "bundled" feature that when +enabled, will download the PostgreSQL installation archive at compile time, include it in your binary and install from +the binary version at runtime. In either case, PostgreSQL will run in a separate process space. ## Features diff --git a/postgresql_archive/README.md b/postgresql_archive/README.md index 9d15248..7b29835 100644 --- a/postgresql_archive/README.md +++ b/postgresql_archive/README.md @@ -3,7 +3,6 @@ [![ci](https://github.com/theseus-rs/postgresql-embedded/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/theseus-rs/postgresql-embedded/actions/workflows/ci.yml) [![Documentation](https://docs.rs/postgresql_archive/badge.svg)](https://docs.rs/postgresql_archive) [![Code Coverage](https://codecov.io/gh/theseus-rs/postgresql-embedded/branch/main/graph/badge.svg)](https://codecov.io/gh/theseus-rs/postgresql-embedded) -[![Benchmarks](https://img.shields.io/badge/%F0%9F%90%B0_bencher-enabled-6ec241)](https://bencher.dev/perf/theseus-rs-postgresql-embedded) [![Latest version](https://img.shields.io/crates/v/postgresql_archive.svg)](https://crates.io/crates/postgresql_archive) [![License](https://img.shields.io/crates/l/postgresql_archive?)](https://github.com/theseus-rs/postgresql-embedded/tree/main/postgresql_archive#license) [![Semantic Versioning](https://img.shields.io/badge/%E2%9A%99%EF%B8%8F_SemVer-2.0.0-blue)](https://semver.org/spec/v2.0.0.html) @@ -44,21 +43,20 @@ fn main() -> Result<()> { ## Feature flags -postgresql_archive uses [feature flags] to address compile time and binary size -uses. +postgresql_archive 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 | -| `indicatif` | Enables tracing-indcatif support | No | -| `tls-native-tls` | Enables Native TLS support | Yes | -| `tls-rustls-aws-lc-rs` | Enables Rustls with the AWS-LC crypto provider | No | -| `tls-rustls-ring` | Enables Rustls with the Ring crypto provider | No | +| Name | Description | Default? | +|------------------------|------------------------------------------------|----------| +| `blocking` | Enables the blocking API | No | +| `indicatif` | Enables tracing-indcatif support | No | +| `tls-native-tls` | Enables Native TLS support | Yes | +| `tls-rustls-aws-lc-rs` | Enables Rustls with the AWS-LC crypto provider | No | +| `tls-rustls-ring` | Enables Rustls with the Ring crypto provider | No | -To use Ring without compiling AWS-LC, disable default features and enable `tls-rustls-ring` together with the -required configuration and extractor features. +To use Ring without compiling AWS-LC, disable default features and enable `tls-rustls-ring` together with the required +configuration and extractor features. ### Configurations diff --git a/postgresql_archive/src/lib.rs b/postgresql_archive/src/lib.rs index ccff1cb..76f9795 100644 --- a/postgresql_archive/src/lib.rs +++ b/postgresql_archive/src/lib.rs @@ -1,7 +1,6 @@ //! # postgresql_archive //! //! [![Code Coverage](https://codecov.io/gh/theseus-rs/postgresql-embedded/branch/main/graph/badge.svg)](https://codecov.io/gh/theseus-rs/postgresql-embedded) -//! [![Benchmarks](https://img.shields.io/badge/%F0%9F%90%B0_bencher-enabled-6ec241)](https://bencher.dev/perf/theseus-rs-postgresql-embedded) //! [![License](https://img.shields.io/crates/l/postgresql_archive?)](https://github.com/theseus-rs/postgresql-embedded/tree/main/postgresql_archive#license) //! [![Semantic Versioning](https://img.shields.io/badge/%E2%9A%99%EF%B8%8F_SemVer-2.0.0-blue)](https://semver.org/spec/v2.0.0.html) //! diff --git a/postgresql_embedded/README.md b/postgresql_embedded/README.md index 362986e..9285d9d 100644 --- a/postgresql_embedded/README.md +++ b/postgresql_embedded/README.md @@ -3,19 +3,17 @@ [![ci](https://github.com/theseus-rs/postgresql-embedded/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/theseus-rs/postgresql-embedded/actions/workflows/ci.yml) [![Documentation](https://docs.rs/postgresql_embedded/badge.svg)](https://docs.rs/postgresql_embedded) [![Code Coverage](https://codecov.io/gh/theseus-rs/postgresql-embedded/branch/main/graph/badge.svg)](https://codecov.io/gh/theseus-rs/postgresql-embedded) -[![Benchmarks](https://img.shields.io/badge/%F0%9F%90%B0_bencher-enabled-6ec241)](https://bencher.dev/perf/theseus-rs-postgresql-embedded) [![Latest version](https://img.shields.io/crates/v/postgresql_embedded.svg)](https://crates.io/crates/postgresql_embedded) [![License](https://img.shields.io/crates/l/postgresql_embedded)](https://github.com/theseus-rs/postgresql-embedded/tree/main/postgresql_embedded#license) [![Semantic Versioning](https://img.shields.io/badge/%E2%9A%99%EF%B8%8F_SemVer-2.0.0-blue)](https://semver.org/spec/v2.0.0.html) -Install and run a PostgreSQL database locally on Linux, MacOS or Windows. PostgreSQL can be -bundled with your application, or downloaded on demand. +Install and run a PostgreSQL database locally on Linux, MacOS or Windows. PostgreSQL can be bundled with your +application, or downloaded on demand. -This library provides an embedded-like experience for PostgreSQL similar to what you would have with -SQLite. This is accomplished by downloading and installing PostgreSQL during runtime. There is -also a "bundled" feature that when enabled, will download the PostgreSQL installation archive at -compile time, include it in your binary and install from the binary version at runtime. -In either case, PostgreSQL will run in a separate process space. +This library provides an embedded-like experience for PostgreSQL similar to what you would have with SQLite. This is +accomplished by downloading and installing PostgreSQL during runtime. There is also a "bundled" feature that when +enabled, will download the PostgreSQL installation archive at compile time, include it in your binary and install from +the binary version at runtime. In either case, PostgreSQL will run in a separate process space. ## Features @@ -123,53 +121,51 @@ async fn main() -> Result<()> { ## Information -During the build process, when the `bundled` feature is enabled, the PostgreSQL binaries are -downloaded and included in the resulting binary. The version of the PostgreSQL binaries is -determined by the `POSTGRESQL_VERSION` environment variable. If the `POSTGRESQL_VERSION` -environment variable is not set, then `postgresql_archive::LATEST` will be used to determine the -version of the PostgreSQL binaries to download. +During the build process, when the `bundled` feature is enabled, the PostgreSQL binaries are downloaded and included in +the resulting binary. The version of the PostgreSQL binaries is determined by the `POSTGRESQL_VERSION` environment +variable. If the `POSTGRESQL_VERSION` +environment variable is not set, then `postgresql_archive::LATEST` will be used to determine the version of the +PostgreSQL binaries to download. When downloading the theseus PostgreSQL binaries, either during build, or at runtime, the -`GITHUB_TOKEN` environment variable can be set to a GitHub personal access token to increase -the rate limit for downloading the PostgreSQL binaries. The `GITHUB_TOKEN` environment -variable is not required. +`GITHUB_TOKEN` environment variable can be set to a GitHub personal access token to increase the rate limit for +downloading the PostgreSQL binaries. The `GITHUB_TOKEN` environment variable is not required. At runtime, the PostgreSQL binaries are cached by default in the following directories: - Unix: `$HOME/.theseus/postgresql` - Windows: `%USERPROFILE%\.theseus\postgresql` -Performance can be improved by using a specific version of the PostgreSQL binaries (e.g. `=16.4.0`). -After the first download, the PostgreSQL binaries will be cached and reused for subsequent runs. -Further, the repository will no longer be queried to calculate the version match. +Performance can be improved by using a specific version of the PostgreSQL binaries (e.g. `=16.4.0`). After the first +download, the PostgreSQL binaries will be cached and reused for subsequent runs. Further, the repository will no longer +be queried to calculate the version match. ## Feature flags -postgresql_embedded uses feature flags to address compile time and binary size -uses. +postgresql_embedded uses feature flags to address compile time and binary size uses. The following features are available: -| Name | Description | Default? | -|----------------------------|----------------------------------------------------------|----------| -| `bundled` | Bundles the PostgreSQL archive into the resulting binary | No | -| `blocking` | Enables the blocking API; requires `tokio` | No | -| `indicatif` | Enables tracing-indcatif support | No | -| `tls-native-tls` | Enables Native TLS support | Yes | -| `tls-rustls-aws-lc-rs` | Enables Rustls with the AWS-LC crypto provider | No | -| `tls-rustls-ring` | Enables Rustls with the Ring crypto provider | No | -| `theseus` | Enables theseus PostgreSQL binaries | Yes | -| `tokio` | Enables using tokio for async | No | -| `zonky` | Enables zonky PostgreSQL binaries | No | - -To use Ring without compiling AWS-LC, disable default features and enable `tls-rustls-ring` together with the -required PostgreSQL binary source features. +| Name | Description | Default? | +|------------------------|----------------------------------------------------------|----------| +| `bundled` | Bundles the PostgreSQL archive into the resulting binary | No | +| `blocking` | Enables the blocking API; requires `tokio` | No | +| `indicatif` | Enables tracing-indcatif support | No | +| `tls-native-tls` | Enables Native TLS support | Yes | +| `tls-rustls-aws-lc-rs` | Enables Rustls with the AWS-LC crypto provider | No | +| `tls-rustls-ring` | Enables Rustls with the Ring crypto provider | No | +| `theseus` | Enables theseus PostgreSQL binaries | Yes | +| `tokio` | Enables using tokio for async | No | +| `zonky` | Enables zonky PostgreSQL binaries | No | + +To use Ring without compiling AWS-LC, disable default features and enable `tls-rustls-ring` together with the required +PostgreSQL binary source features. ## 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 +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 diff --git a/postgresql_embedded/src/lib.rs b/postgresql_embedded/src/lib.rs index 6c38d8f..736b9d5 100644 --- a/postgresql_embedded/src/lib.rs +++ b/postgresql_embedded/src/lib.rs @@ -1,7 +1,6 @@ //! # postgresql_embedded //! //! [![Code Coverage](https://codecov.io/gh/theseus-rs/postgresql-embedded/branch/main/graph/badge.svg)](https://codecov.io/gh/theseus-rs/postgresql-embedded) -//! [![Benchmarks](https://img.shields.io/badge/%F0%9F%90%B0_bencher-enabled-6ec241)](https://bencher.dev/perf/theseus-rs-postgresql-embedded) //! [![License](https://img.shields.io/crates/l/postgresql_embedded)](https://github.com/theseus-rs/postgresql-embedded/tree/main/postgresql_embedded#license) //! [![Semantic Versioning](https://img.shields.io/badge/%E2%9A%99%EF%B8%8F_SemVer-2.0.0-blue)](https://semver.org/spec/v2.0.0.html) //! diff --git a/postgresql_extensions/README.md b/postgresql_extensions/README.md index e6f3d5c..ed8c146 100644 --- a/postgresql_extensions/README.md +++ b/postgresql_extensions/README.md @@ -3,7 +3,6 @@ [![ci](https://github.com/theseus-rs/postgresql-embedded/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/theseus-rs/postgresql-embedded/actions/workflows/ci.yml) [![Documentation](https://docs.rs/postgresql_extensions/badge.svg)](https://docs.rs/postgresql_extensions) [![Code Coverage](https://codecov.io/gh/theseus-rs/postgresql-embedded/branch/main/graph/badge.svg)](https://codecov.io/gh/theseus-rs/postgresql-embedded) -[![Benchmarks](https://img.shields.io/badge/%F0%9F%90%B0_bencher-enabled-6ec241)](https://bencher.dev/perf/theseus-rs-postgresql-embedded) [![Latest version](https://img.shields.io/crates/v/postgresql_extensions.svg)](https://crates.io/crates/postgresql_extensions) [![License](https://img.shields.io/crates/l/postgresql_extensions?)](https://github.com/theseus-rs/postgresql-embedded/tree/main/postgresql_extensions#license) [![Semantic Versioning](https://img.shields.io/badge/%E2%9A%99%EF%B8%8F_SemVer-2.0.0-blue)](https://semver.org/spec/v2.0.0.html) @@ -38,20 +37,19 @@ async fn main() -> Result<()> { ## Feature flags -postgresql_extensions uses [feature flags] to address compile time and binary size -uses. +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 | -| `tls-native-tls` | Enables Native TLS support | Yes | -| `tls-rustls-aws-lc-rs` | Enables Rustls with the AWS-LC crypto provider | No | -| `tls-rustls-ring` | Enables Rustls with the Ring crypto provider | No | +| Name | Description | Default? | +|------------------------|------------------------------------------------|----------| +| `blocking` | Enables the blocking API | No | +| `tls-native-tls` | Enables Native TLS support | Yes | +| `tls-rustls-aws-lc-rs` | Enables Rustls with the AWS-LC crypto provider | No | +| `tls-rustls-ring` | Enables Rustls with the Ring crypto provider | No | -To use Ring without compiling AWS-LC, disable default features and enable `tls-rustls-ring` together with the -required repository features. +To use Ring without compiling AWS-LC, disable default features and enable `tls-rustls-ring` together with the required +repository features. ### Repositories diff --git a/postgresql_extensions/src/lib.rs b/postgresql_extensions/src/lib.rs index 83e3e90..ed0b0b2 100644 --- a/postgresql_extensions/src/lib.rs +++ b/postgresql_extensions/src/lib.rs @@ -3,7 +3,6 @@ //! [![ci](https://github.com/theseus-rs/postgresql-embedded/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/theseus-rs/postgresql-embedded/actions/workflows/ci.yml) //! [![Documentation](https://docs.rs/postgresql_extensions/badge.svg)](https://docs.rs/postgresql_extensions) //! [![Code Coverage](https://codecov.io/gh/theseus-rs/postgresql-embedded/branch/main/graph/badge.svg)](https://codecov.io/gh/theseus-rs/postgresql-embedded) -//! [![Benchmarks](https://img.shields.io/badge/%F0%9F%90%B0_bencher-enabled-6ec241)](https://bencher.dev/perf/theseus-rs-postgresql-embedded) //! [![Latest version](https://img.shields.io/crates/v/postgresql_extensions.svg)](https://crates.io/crates/postgresql_extensions) //! [![License](https://img.shields.io/crates/l/postgresql_extensions?)](https://github.com/theseus-rs/postgresql-embedded/tree/main/postgresql_extensions#license) //! [![Semantic Versioning](https://img.shields.io/badge/%E2%9A%99%EF%B8%8F_SemVer-2.0.0-blue)](https://semver.org/spec/v2.0.0.html)