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 more instances of SQLite "too many variables" errors #77

Merged
merged 1 commit into from
Jul 6, 2024

Conversation

kylewlacy
Copy link
Member

This PR fixes a failure that cropped up in the brioche-packages repo (e.g. in CI #148) with the following error message:

Error: error returned from database: (code: 1) too many SQL variables: (code: 1) too many SQL variables

I was able to reproduce locally by moving my ~/.local/share/brioche directory somewhere else then running brioche build -p ./packages/nushell. This resulted too many SQLite variables being used in a single query (the limit is either 999 or 32,766 depending on the SQLite version)

The fix in this PR is simple: batch the query to limit the max number of records fetched / inserted per query, thereby limiting the number of SQLite variables used

@kylewlacy kylewlacy merged commit ca46947 into main Jul 6, 2024
5 checks passed
@kylewlacy kylewlacy deleted the fix-sqlite-too-many-variables-error branch July 6, 2024 04:42
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