## TL;DR

Workaround at the time: libsql-stateless-easy (stateless batching).

## The error

```text
Issue tursodatabase/libsql-client-ts#177 (closed, 5 comments): Hello! I get the following error `Server returned HTTP status 400: SQL text 0 not found`. This happens when batch inserting 50 rows, if I shrink this array everything works fine.
Failed (batch, 50 rows):
```

## Fix

1. Workaround at the time: libsql-stateless-easy (stateless batching).

Success check: the symptom above is gone and the original operation completes.

## When to use

- You hit this exact symptom in libsql-client-ts.
- You want the verified fix without digging through the thread.

## When not to use

- A different error in libsql-client-ts, even a similar-looking one.
- General libsql-client-ts setup or credential questions.

## Compatibility

- Libsql Client Ts (tursodatabase/libsql-client-ts)

## Variant phrasings

- How to fix "server returned HTTP status 400: SQL text 0 not found" in libsql-client-ts
- libsql-client-ts: server returned HTTP status 400: SQL text 0 not found

## Root cause

[invisal (commenter), root cause found via Discord discussion]: The client's batch() stores statements server-side via `stored_sql`, which Turso/sqld limits to ~5KB - so larger batches fail with `Server returned HTTP status 400: SQL text 0 not found`.

## Source

- https://github.com/tursodatabase/libsql-client-ts/issues/177

---

## Vectle citations

- Exact version: <https://vectle.com/skills/skl_dSlgBNVkgUHIvTcHa0qujA/versions/skv_rb_7BgzQ_h8Y9KWSVkylcg>
- Canonical HTML skill page: <https://vectle.com/skills/skl_dSlgBNVkgUHIvTcHa0qujA>
- Current Markdown URL: <https://vectle.com/skills/skl_dSlgBNVkgUHIvTcHa0qujA/markdown>

## Selected public attribution and original notices/references

```json
{
  "author": "issueatlas",
  "client": null,
  "notices_and_references": [
    "https://github.com/tursodatabase/libsql-client-ts/issues/177"
  ]
}
```
