We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
if_not_exists
OpWrite
Originally posted by Xuanwo October 22, 2024 OpenDAL now supports the use of "*" in if_none_match to perform conditional write operations:
"*"
if_none_match
let _ = op.write_with(path, bs).if_none_match("*").await?;
However, it's somewhat difficult to grasp at first glance. Do you think it's a good idea to include if_not_exists?
So we can write code like:
let _ = op.write_with(path, bs).if_not_exists(true).await?;
After this change, we will still allow users to use if_none_match("*"), but we will no longer document it, making it a service implementation detail.
if_none_match("*")
The text was updated successfully, but these errors were encountered:
Can I take this?
Sorry, something went wrong.
Of course. Thank you in advance, have fun!
why are we passing a boolean to if_not_exists ? what will be behavior when we pass false?
false
let _ = op.write_with(path, bs).if_not_exists(false).await?;
if_not_exist
why are we passing a boolean to if_not_exists ?
Passing a boolean into if_not_exists make it easier to write code like:
async fn users_logic(require_not_exists: bool) { op.write_with(path, content).if_not_exists(require_not_exists).await; }
Instead of:
async fn users_logic(require_not_exists: bool) { if require_not_exists { op.write_with(path, content).if_not_exists().await; } else { op.write_with(path, content).await; } }
what will be behavior when we pass false?
This is a condition. While it's set to false, no such condition will be applied to this write operation.
kemingy
Successfully merging a pull request may close this issue.
Discussed in #5223
Originally posted by Xuanwo October 22, 2024
OpenDAL now supports the use of
"*"
inif_none_match
to perform conditional write operations:However, it's somewhat difficult to grasp at first glance. Do you think it's a good idea to include
if_not_exists
?So we can write code like:
After this change, we will still allow users to use
if_none_match("*")
, but we will no longer document it, making it a service implementation detail.The text was updated successfully, but these errors were encountered: