feat(sqlite): make thread_stack_size optional with safe defaults
Changes thread_stack_size from usize to Option<usize> to address concerns about safety and platform compatibility.
Key improvements:
- Default to
None, using Rust std's default stack size (typically 2MB) - Only apply custom stack size when explicitly configured
- Safer for user callbacks with unpredictable stack requirements
- Platform-agnostic (handles 32-bit vs 64-bit differences automatically)
- Marked as an advanced option in documentation with appropriate warnings
This addresses the feedback from PR #3885 about hardcoded stack sizes being unsafe due to:
- Unpredictable stack needs of user-supplied callbacks
- Platform-specific requirements (32-bit vs 64-bit)
- Need for conservative defaults
Related: #3885
Does your PR solve an issue?
Delete this text and add "fixes #(issue number)".
Do not just list issue numbers here as they will not be automatically closed on merging this pull request unless prefixed with "fixes" or "closes".
Is this a breaking change?
Delete this text and answer yes/no and explain.
If yes, this pull request will need to wait for the next major release (0.{x + 1}.0)
Behavior changes can be breaking if significant enough. Consider Hyrum's Law:
With a sufficient number of users of an API,
it does not matter what you promise in the contract:
all observable behaviors of your system
will be depended on by somebody.
@ZenasSong please run cargo fmt.