libsql-client-ts
libsql-client-ts copied to clipboard
fix: only cache statement under 5kb
Batch is using stored_sql. In the Turso server, the stored_sql only support up to 5kb only.
https://github.com/tursodatabase/libsql/blob/e9d637e051685f92b0da43849507b5ef4232fbeb/libsql-server/src/hrana/http/request.rs#L10
- Checking 5,000 characters doesnt seem like good idea given that unicode character might takes multiple bytes. One solution is to check 1,000 characters instead. Unicode at most takes 4 bytes. 5,000 / 4= 1250 characters.
- Or we can just remove the SQL cache in the batch
Related to this issue: https://github.com/tursodatabase/libsql-client-ts/issues/177#issuecomment-2040989370