Skip to content

Bind SQL lists as one JSON parameter - #7

Merged
RhysSullivan merged 1 commit into
mainfrom
fix/workerd-sql-param-limit
Sep 30, 2026
Merged

RhysSullivan merged 1 commit into
mainfrom
fix/workerd-sql-param-limit

Conversation

@RhysSullivan

Copy link
Copy Markdown

workerd binds at most 100 parameters per SQL statement. The store built one placeholder per value for batched inserts and IN lists, so on workerd:

  • An export of more than 33 spans lost its operation search rows. The failure was caught as "FTS is optional", so those spans silently vanished from /api/spans/search.
  • A span or log with more than 25 attributes failed its whole export.
  • Queries that looked up more than 100 traces or spans failed.

Every list-valued input now binds as one JSON array and expands with json_each, on both runtimes. This also removes the per-length prepared-statement caches.

Verified: bun test (218 pass), and typecheck.

@RhysSullivan
RhysSullivan marked this pull request as ready for review September 30, 2026 07:03
@RhysSullivan
RhysSullivan merged commit b94957c into main Sep 30, 2026
1 check passed
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.

1 participant