Skip to content

refactor!: move version from PostgreSQL::new() to Settings #82

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 1 commit into from
Jun 21, 2024

Conversation

brianheineman
Copy link
Contributor

@brianheineman brianheineman commented Jun 21, 2024

This PR makes significant changes to the way the PostgreSQL Version is managed. The version is moved into Settings to provide a consistent configuration approach. This also enables the version to be configured from a URL.

API Changes

  • added Settings.version: Version
  • changed postgresql_embedded::PostgreSQL::new(Version,Settings) to postgresql_embedded::PostgreSQL::new(Settings)
  • removed postgresql_embedded::PostgreSQL.version()
  • removed postgresql_embedded::PostgreSQL::default_version()
  • changed postgresql_embedded::blocking::PostgreSQL::new(Version,Settings) to postgresql_embedded::blocking::PostgreSQL::new(Settings)
  • removed postgresql_embedded::blocking::PostgreSQL.version()

Migration
If a specific version was being specified, then the code can generally change from this:

let version = V15;
let settings = Settings::default();
let postgresql = PostgreSQL::new(version, settings);

to this:

let version = V15;
let settings = Settings {
    version,
    ..Settings::default()
};
let postgresql = PostgreSQL::new(settings);

@github-actions github-actions bot added breaking Change that breaks backwards compatibility internal An internal refactor or improvement labels Jun 21, 2024
Copy link
Contributor

🐰Bencher

ReportFri, June 21, 2024 at 19:46:03 UTC
Projecttheseus-rs/postgresql-embedded
Branchrefactor-version
Testbedlocalhost

⚠️ WARNING: The following Measure does not have a Threshold. Without a Threshold, no Alerts will ever be generated!

  • Latency (latency)

Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the --ci-only-thresholds CLI flag.

Click to view all benchmark results
BenchmarkLatencyLatency Results
nanoseconds (ns)
extract➖ (view plot)152,170.00
lifecycle➖ (view plot)904,920,000.00

Bencher - Continuous Benchmarking
View Public Perf Page
Docs | Repo | Chat | Help

Copy link

codecov bot commented Jun 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.75%. Comparing base (4055763) to head (589596b).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #82      +/-   ##
==========================================
- Coverage   99.78%   99.75%   -0.03%     
==========================================
  Files          59       59              
  Lines        7775     7775              
==========================================
- Hits         7758     7756       -2     
- Misses         17       19       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@brianheineman brianheineman merged commit 0ef2c97 into main Jun 21, 2024
@brianheineman brianheineman deleted the refactor-version branch June 21, 2024 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Change that breaks backwards compatibility internal An internal refactor or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant