tursodatabase / tursodatabase/libsql

libsql execute does not return same result as ruslite execute

Open
#279 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
17.2k
Forks
531
Avg merge
1h 12m
Merged PRs (30d)
1

Description

rusqlite:

    pub fn execute<P: Params>(&self, sql: &str, params: P) -> Result<usize> {
        self.prepare(sql)
            .and_then(|mut stmt| stmt.check_no_tail().and_then(|_| stmt.execute(params)))
    }

libsql:

    pub fn execute<S, P>(&self, sql: S, params: P) -> Result<Option<Rows>>
    where
        S: Into<String>,
        P: Into<Params>,

The return value for rusqlite is documented as:

On success, returns the number of rows that were changed or inserted or deleted (via sqlite3_changes).

If you expect rows with rusqlite, it looks like you have to use query on a statement.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing libsql's execute API with the rusqlite execute contract described in the issue, then inspect how query on a statement handles returned rows. Done means execute has behavior and return semantics consistent with the documented rusqlite expectation, with coverage for changed, inserted, or deleted rows.

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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.