Skip to content

Commit 443190a

Browse files
committed
file creation fix
1 parent 404dcc3 commit 443190a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

crates/app/core/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,9 @@ async fn create_database_pool(options: CreateDatabasePoolOptions) -> Result<sqlx
133133
let (pool_options, pool_max_connections) = if database_url.starts_with("sqlite:") {
134134
// Workaround for issue with `zig cc -target x86_64-linux-gnu` not working with create_if_missing.
135135
if database_url != "sqlite::memory:" {
136-
tokio::fs::File::create(options.database_url.path()).await?;
136+
if tokio::fs::metadata(options.database_url.path()).await.is_err() {
137+
tokio::fs::File::create(options.database_url.path()).await?;
138+
}
137139
}
138140
let pool_options = database_url
139141
.parse::<sqlx::sqlite::SqliteConnectOptions>()?

0 commit comments

Comments
 (0)