add test for bind binary not null constraint

This commit is contained in:
Alexey Proshutinskiy
2021-09-02 13:05:11 +03:00
parent f821a3c891
commit 9553388096
3 changed files with 61 additions and 0 deletions

View File

@ -84,3 +84,26 @@ pub fn test3() {
println!("age = {}", row[1].as_integer().unwrap());
}
}
#[marine]
pub fn test4() {
use marine_sqlite_connector::Value;
let connection = marine_sqlite_connector::open(":memory:").unwrap();
connection
.execute(
"
CREATE TABLE users (name TEXT, age BLOB NOT NULL);
",
)
.unwrap();
let mut cursor = connection
.prepare("INSERT OR REPLACE INTO users VALUES (?, ?)").unwrap();
cursor.bind(1, &Value::Integer(50)).unwrap();
cursor.bind(2, &Value::Binary(vec![1, 2, 3])).unwrap();
cursor.next().unwrap();
}