pub(crate) async fn upsert_setting(
client: &(impl GenericClient + Sync),
key: &str,
value: &str,
) -> Result<(), AppError>Expand description
写入(或覆盖)单个 settings 键,同时刷新 updated_at。
面板保存、调度结果落库等处共用这一条 upsert。接受 tokio_postgres 的
GenericClient,连接与事务都能调用:deadpool 连接传 &**client,
deadpool 事务传 &*tx。多键写入由调用方逐键调用,事务边界由调用方决定。