Skip to content

Commit

Permalink
Merge pull request #413 from julianbraha/main
Browse files Browse the repository at this point in the history
Replace tempdir dependency with tempfile
  • Loading branch information
Brendonovich authored Nov 20, 2023
2 parents e7d7475 + a655add commit 7c7d721
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 67 deletions.
64 changes: 1 addition & 63 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions crates/lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ default = []
rspc = ["dep:rspc", "specta"]
specta = ["dep:specta", "prisma-client-rust-generator-macros/specta"]
sqlite-create-many = ["psl/sqlite-create-many"]
migrations = ["schema-core", "dep:include_dir", "dep:tempdir", "tokio/fs", "dep:tracing"]
migrations = ["schema-core", "dep:include_dir", "dep:tempfile", "tokio/fs", "dep:tracing"]
mocking = ["tokio"]
# mutation-callbacks = []

Expand Down Expand Up @@ -47,7 +47,7 @@ query-core = { workspace = true }
# features = "migrations"
schema-core = { workspace = true, optional = true }
include_dir = { version = "0.7.2", optional = true }
tempdir = { version = "0.3.7", optional = true }
tempfile = { version = "3.5.0", optional = true }
tracing = { version = "0.1.36", optional = true }

# features = "specta"
Expand Down
8 changes: 6 additions & 2 deletions crates/lib/src/migrations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,9 @@ impl<'a> Future for MigrateDeploy<'a> {
self.fut = Some(Box::pin(async move {
let temp_dir = match temp_dir {
Some(d) => d.to_string(),
None => tempdir::TempDir::new("prisma-client-rust-migrations")
None => tempfile::Builder::new()
.prefix("prisma-client-rust-migrations")
.tempdir()
.map_err(MigrateDeployError::CreateDir)?
.into_path()
.to_str()
Expand Down Expand Up @@ -234,7 +236,9 @@ pub async fn migrate_resolve(
migrations: &include_dir::Dir<'_>,
url: &str,
) -> Result<(), MigrateResolveError> {
let temp_dir = tempdir::TempDir::new("prisma-client-rust-migrations")
let temp_dir = tempfile::Builder::new()
.prefix("prisma-client-rust-migrations")
.tempdir()
.map_err(MigrateResolveError::CreateDir)?
.into_path();

Expand Down

1 comment on commit 7c7d721

@vercel
Copy link

@vercel vercel bot commented on 7c7d721 Nov 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.