1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/// Macro that replaces JSON nullability strings with the
/// appropriate representation based on the connector capabilities.
/// Allows us to reuse tests instead of copying.
#[macro_export]
macro_rules! jNull {
    ($capabilities:expr, $s:expr) => {
        if !$capabilities.contains(ConnectorCapability::AdvancedJsonNullability) {
            $s.replace("DbNull", "null")
                .replace("JsonNull", "\"null\"")
                .replace("AnyNull", "null")
        } else {
            $s.to_owned()
        }
    };
}