Add set_config_bool, fix rust test to test the current expected behavior

This commit is contained in:
Hocuri
2021-02-02 21:57:41 +01:00
parent e820d072f5
commit 8ac2cdd929
2 changed files with 33 additions and 14 deletions

View File

@@ -290,6 +290,11 @@ impl Context {
_ => self.sql.set_raw_config(self, key, value).await,
}
}
pub async fn set_config_bool(&self, key: Config, value: bool) -> crate::sql::Result<()> {
self.set_config(key, if value { Some("1") } else { None })
.await
}
}
/// Returns all available configuration keys concated together.