Skip to content
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

Replace tempdir dependency with tempfile #413

Merged
merged 1 commit into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading