tursodatabase / tursodatabase/libsql

Prepared statement in a specific database kinda fails

Open
#1,831 0 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

Hi! I've been using libsql and I've run into this problem when asking for a entry in this database (written using atlas HCL) what happens is that every two requests I get a blank one, so that's one with data and one without using this query:

"select name, data from documents where hash = ? and user_id = ?;"

Now, this only happens when using prepared statements and not direct execution (in that case the data is retrieved correctly). I am using a local database.

Let me know if I can give you more details to debug this problem, have a wonderful day!

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 reproducing the alternating-result behavior with the linked database definition and the prepared query, then compare it with direct execution. Trace the prepared-statement entry point involved in local database queries; done means repeated requests return the same correct row as direct execution.

Written by the indexing model from the issue text.

Assessment

Tech stack
sqlite
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.