tursodatabase / tursodatabase/libsql
conn.changes() always returns 0 on remote connection.
Open
Nobody has claimed this yet.
bug
remote protocol
- Dominant language
- C
- Stars
- 17.2k
- Forks
- 531
- Avg merge
- 1h 12m
- Merged PRs (30d)
- 1
Description
let conn = Builder::new_remote("http://localhost:8867".into(), "".into())...;
conn.execute_batch(r#"CREATE TABLE IF NOT EXISTS example (id INTEGER NOT NULL PRIMARY KEY);"#)...;
conn.query(r#"INSERT INTO example DEFAULT VALUES RETURNING *;"#, ())
.await
.unwrap();
// Error
assert_eq!(conn.changes(), 1);
// or
let mut stam = conn
.prepare(r#"INSERT INTO example DEFAULT VALUES RETURNING *;"#)
.await
.unwrap();
stam.query(()).await.unwrap();
// Error
assert_eq!(conn.changes(), 1);
assertion `left == right` failed
left: 0
right: 1
It seems that only the query method of the remote connection has an issue; there are no problems whatsoever when using a local connection.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Builder::new_remote connection path and compare conn.query with prepare followed by query, focusing on how conn.changes() is reported. Reproduce both examples against the remote connection and verify that an INSERT returning one row reports changes() as 1, while local connection behavior remains unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust, sqlite
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100