-
Notifications
You must be signed in to change notification settings - Fork 448
Open
Description
A reproducing example:
use libsql::Builder;
#[tokio::main]
async fn main() {
let database = Builder::new_local(":memory:").build().await.unwrap();
let connection = database.connect().unwrap();
connection
.execute("CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT)", ())
.await
.unwrap();
let insert_user = connection
.prepare("INSERT INTO users (id, name) VALUES (?,?)")
.await
.unwrap();
insert_user.execute((1, "John Doe")).await.unwrap();
insert_user.execute((2, "Jane Doe")).await.unwrap(); // Error: UNIQUE constraint failed: users.id
}If removing the unique constraint, and querying the table, one can also see, that the second insert statement indeed inserts using a 1 for the id.
Metadata
Metadata
Assignees
Labels
No labels