uf-valence-backend-sql 0.1.2

Shared SQL helpers for Valence SQL backends (SQLite, Postgres)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
//! JSON merge helpers.

use serde_json::{Map, Value};

/// Shallow merge `patch` into `base`.
pub fn json_merge(base: &mut Map<String, Value>, patch: &Map<String, Value>) {
    for (k, v) in patch {
        if k != "id" {
            base.insert(k.clone(), v.clone());
        }
    }
}