Add asset status management

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2024-02-09 15:43:42 +00:00
parent 76bf2fddcb
commit dee21d5324
8 changed files with 249 additions and 15 deletions

View File

@@ -45,3 +45,19 @@ where
.execute()
.await
}
pub async fn update_status_where_symbol<T>(
clickhouse_client: &Client,
symbol: &T,
status: bool,
) -> Result<(), Error>
where
T: AsRef<str> + Serialize + Send + Sync,
{
clickhouse_client
.query("ALTER TABLE assets UPDATE status = ? WHERE symbol = ?")
.bind(status)
.bind(symbol)
.execute()
.await
}