Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: only cache statement under 5kb #198

Merged
merged 1 commit into from
Jun 3, 2024

Conversation

invisal
Copy link
Contributor

@invisal invisal commented Apr 6, 2024

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:
#177 (comment)

@invisal invisal force-pushed the only-cache-small-statement branch from 34533e7 to e3b0b6c Compare April 6, 2024 07:23
@invisal invisal force-pushed the only-cache-small-statement branch from e3b0b6c to 06debb5 Compare April 6, 2024 07:37
@penberg penberg merged commit 8da38aa into tursodatabase:main Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants