Skip to content

Commit 5e942bc

Browse files
Merge pull request #42 from theseus-rs/settings-from-url
feat: add ability to create settings from a url
2 parents 68aea10 + 015c153 commit 5e942bc

File tree

6 files changed

+146
-41
lines changed

6 files changed

+146
-41
lines changed

Cargo.lock

Lines changed: 40 additions & 39 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ tempfile = "3.10.1"
4040
thiserror = "1.0.58"
4141
tokio = "1.36.0"
4242
tracing = "0.1.40"
43+
url = "2.5.0"
4344

4445
[workspace.metadata.release]
4546
shared-version = true

postgresql_archive/src/archive.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ fn acquire_lock(out_dir: &Path) -> Result<PathBuf> {
300300
for _ in 0..30 {
301301
let lock = std::fs::OpenOptions::new()
302302
.create(true)
303+
.truncate(true)
303304
.write(true)
304305
.open(&lock_file);
305306

postgresql_embedded/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ tempfile = { workspace = true }
2626
thiserror = { workspace = true }
2727
tokio = { workspace = true, features = ["full"], optional = true }
2828
tracing = { workspace = true, features = ["log"] }
29+
url = { workspace = true }
2930

3031
[dev-dependencies]
3132
criterion = { workspace = true }

postgresql_embedded/src/error.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ pub enum Error {
3030
/// Error when the database could not be dropped
3131
#[error(transparent)]
3232
DropDatabaseError(anyhow::Error),
33+
/// Error when an invalid URL is provided
34+
#[error("Invalid URL: {url}; {message}")]
35+
InvalidUrl { url: String, message: String },
3336
/// Error when IO operations fail
3437
#[error(transparent)]
3538
IoError(anyhow::Error),

0 commit comments

Comments
 (0)