Add WebAssembly memory configuration for large SQL files #136
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add WebAssembly memory configuration for large SQL files
Summary
This PR adds Emscripten memory configuration flags to prevent "memory access out of bounds" errors when parsing large SQL files with the WebAssembly build of libpg_query. The changes set a larger initial heap (256MB) and higher maximum memory limit (1GB) while preserving dynamic memory growth and all existing module exports.
Key Changes:
-sINITIAL_MEMORY=268435456
(256MB initial heap)-sMAXIMUM_MEMORY=1073741824
(1GB maximum memory)-sALLOW_MEMORY_GROWTH=1
for dynamic expansion-sMODULARIZE=1
and all existing exportsReview & Testing Checklist for Human
@pgsql/parser
) and full parser (@libpg-query/parser
) properly inherit the memory settingsDiagram
Notes
copy:templates
script to maintain consistency across all PostgreSQL versions