pub fn upsert_entity(
conn: &Connection,
namespace: &str,
e: &NewEntity,
) -> Result<i64, AppError>Expand description
Upserts an entity and returns its primary key.
Uses ON CONFLICT(namespace, name) to keep one row per entity within a
namespace, refreshing type and description opportunistically.
§Errors
Returns Err(AppError::Database) on any rusqlite failure.