Skip to main content

insert_row

Function insert_row 

Source
pub fn insert_row(table: &str, values: &[(&str, Value)])
Expand description

Inserts a row into table of the test database, for tables without an integer id (a UUID or composite key).

§Panics

Like sql, e.g. on a constraint violation.

§Examples

use ocre::serde_json::json;

ocre::testing::insert_row("videos", &[("id", json!("7f1c…")), ("name", json!("a.mp4"))]);