Error: string or blob too big: SQLITE_TOOBIG

By default, SQLite has a maximum string length (SQLITE_MAX_LENGTH) of a gigabyte, adjustable to around 2GB (docs). I ran in to the following error while adding a row of length 2,288,921 to the new in-durable-object SQLite DB:
Error: string or blob too big: SQLITE_TOOBIG
Error: string or blob too big: SQLITE_TOOBIG
Was this limit intentionally set to 1/500 of the default value? Is there a way of raising it?
1 Reply
Walshy
Walshy2mo ago
https://github.com/cloudflare/workerd/blob/main/src/workerd/util/sqlite.c%2B%2B#L1037
// This limit is set highter than what is suggested on sqlite.org/security.html
// because we want to allow storing values of 1MiB, and we added some extra
// padding on top of that
// This limit is set highter than what is suggested on sqlite.org/security.html
// because we want to allow storing values of 1MiB, and we added some extra
// padding on top of that
so yes, it is and it's actually higher than the sqlite team recommend
Want results from more Discord servers?
Add your server