decode valueless entires as NaN

since NaN == NULL in SQLite, apparently
This commit is contained in:
Tomáš Mládek 2022-03-18 22:22:32 +01:00
parent 164cdcd105
commit 5051ac25c6

View file

@ -50,9 +50,11 @@ impl TryFrom<&models::Entry> for Entry {
value: EntryValue::Number(value_num), value: EntryValue::Number(value_num),
}) })
} else { } else {
Err(anyhow!( Ok(Entry {
"Inconsistent database: Both values of entry are NULL!" entity: Address::decode(&e.entity)?,
)) attribute: e.attribute.clone(),
value: EntryValue::Number(f64::NAN),
})
} }
} }
} }