Skip to main content

insert

Function insert 

Source
pub fn insert(conn: &Connection, mem: &Memory) -> Result<String>
Expand description

Insert with upsert on title+namespace. Returns the ID (existing or new).

Ultrareview #352: collapses the previous INSERT/ON CONFLICT + separate SELECT into a single INSERT ... RETURNING id. Another concurrent writer could otherwise slot in between the two statements and the SELECT would return the wrong row id. SQLite 3.35+ supports RETURNING; it executes atomically within the INSERT.