no-mistakes-postgres-engine 0.109.125

PostgreSQL embedded SQL extraction, schema catalog, and replay-safety analysis for no-mistakes
Documentation
use super::super::{EmbeddedSqlCall, EmbeddedSqlKind};

pub(super) fn record(calls: &[EmbeddedSqlCall]) {
    if let Some(observer) = crate::hooks::current_observer() {
        for call in calls {
            let composed = if call.variants.is_empty() {
                usize::from(call.kind == EmbeddedSqlKind::Composed)
            } else if call
                .variants
                .iter()
                .any(|value| !value.append_sites.is_empty())
            {
                call.variants.len()
            } else {
                0
            };
            observer.increment("postgres.sql.variants_composed", composed as u64);
            observer.increment(
                "postgres.sql.sites_truncated",
                u64::from(call.variants_truncated()),
            );
        }
    }
}