Skip to content

Commit e439ac6

Browse files
Merge pull request #224 from theseus-rs/add-postgresql-v18-support
feat: add postgresql v18 support
2 parents 9a71159 + 368a4d7 commit e439ac6

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

postgresql_embedded/src/lib.rs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
//! - Unix: `$HOME/.theseus/postgresql`
7676
//! - Windows: `%USERPROFILE%\.theseus\postgresql`
7777
//!
78-
//! Performance can be improved by using a specific version of the PostgreSQL binaries (e.g. `=16.4.0`).
78+
//! Performance can be improved by using a specific version of the PostgreSQL binaries (e.g. `=16.10.0`).
7979
//! After the first download, the PostgreSQL binaries will be cached and reused for subsequent runs.
8080
//! Further, the repository will no longer be queried to calculate the version match.
8181
//!
@@ -134,6 +134,9 @@ use std::sync::LazyLock;
134134
/// The latest PostgreSQL version requirement
135135
pub static LATEST: VersionReq = VersionReq::STAR;
136136

137+
/// The latest PostgreSQL version 18
138+
pub static V18: LazyLock<VersionReq> = LazyLock::new(|| VersionReq::parse("=18").unwrap());
139+
137140
/// The latest PostgreSQL version 17
138141
pub static V17: LazyLock<VersionReq> = LazyLock::new(|| VersionReq::parse("=17").unwrap());
139142

@@ -162,8 +165,8 @@ mod tests {
162165

163166
#[test]
164167
fn test_version() -> Result<()> {
165-
let version = VersionReq::parse("=16.4.0")?;
166-
assert_eq!(version.to_string(), "=16.4.0");
168+
let version = VersionReq::parse("=16.10.0")?;
169+
assert_eq!(version.to_string(), "=16.10.0");
167170
Ok(())
168171
}
169172

@@ -172,6 +175,11 @@ mod tests {
172175
assert_eq!(LATEST.to_string(), "*");
173176
}
174177

178+
#[test]
179+
fn test_version_18() {
180+
assert_eq!(V18.to_string(), "=18");
181+
}
182+
175183
#[test]
176184
fn test_version_17() {
177185
assert_eq!(V17.to_string(), "=17");

0 commit comments

Comments
 (0)