tursodatabase / tursodatabase/libsql-client-ts

Fetching too many rows results in RESPONSE_TOO_LARGE

Open
#191 4 comments 15 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
576
Forks
69
PR merge metrics
No merged PRs in 30d

Description

await client.execute("SELECT * FROM ...");

throws

file:///C:/Users/mdash/Documents/.../node_modules/@libsql/client/lib-esm/hrana.js:257
        return new LibsqlError(e.message, code, undefined, e);
               ^

LibsqlError: RESPONSE_TOO_LARGE: Response is too large
    at mapHranaError (file:///C:/Users/mdash/Documents/.../node_modules/@libsql/client/lib-esm/hrana.js:257:16)
    at HttpClient.execute (file:///C:/Users/mdash/Documents/.../node_modules/@libsql/client/lib-esm/http.js:56:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at <anonymous> (...) {
  code: 'RESPONSE_TOO_LARGE',
  rawCode: undefined,
  [cause]: [ResponseError: Response is too large] {
    code: 'RESPONSE_TOO_LARGE',
    proto: { message: 'Response is too large', code: 'RESPONSE_TOO_LARGE' }
  }
}

Node.js v20.10.0

I have 2.4M rows total 180 MB. This isn't that much, the library is supposed to handle it.

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 with HttpClient.execute in lib-esm/http.js and mapHranaError in lib-esm/hrana.js, which appear in the reported trace, then reproduce the SELECT against a result set of similar size. Determine whether the response limit is client- or server-side and identify the expected behavior for large result sets; done requires a confirmed cause and a tested or documented resolution.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, sqlite, typescript
Domain
api, database
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.