Skip to main content

value_ref_to_string

Function value_ref_to_string 

Source
pub fn value_ref_to_string(v: ValueRef<'_>) -> Option<String>
Expand description

Render a changeset/column [ValueRef] as an owned String, or None for SQL NULL. Mirrors sqlite3_value_text: text and blob bytes become a string (lossy on invalid UTF-8), and integers/reals their decimal text — so the _updated_at row-arbitration comparison and blob-plan column reads see the same strings the raw FFI path (gate.rs) produces.

Synced columns coven reads through here — _updated_at, gate columns, FK and blob-plan columns — are expected to be TEXT, INTEGER, or BLOB, never REAL. The REAL arm exists only so a stray float doesn’t silently become None; it renders a faithful (round-tripping) decimal that always shows it is a float (a trailing .0 when there is no fractional part or exponent), matching SQLite’s REAL→text on whole numbers and simple decimals rather than diverging into Rust’s integer-looking f64::to_string (1.0"1"). It does not reproduce SQLite’s exact scientific-notation threshold or 17th-digit rounding — there is no live impact, since no synced column is REAL.