Skip to content

fix: SQLite3 config type handling for .env overrides#10037

Open
michalsn wants to merge 4 commits intocodeigniter4:developfrom
michalsn:fix/database-properties-casting
Open

fix: SQLite3 config type handling for .env overrides#10037
michalsn wants to merge 4 commits intocodeigniter4:developfrom
michalsn:fix/database-properties-casting

Conversation

@michalsn
Copy link
Member

Description
This PR fixes a bug where database config values coming from .env could remain strings and then be assigned to typed SQLite3 connection properties with the wrong type. That could trigger a TypeError for synchronous or cause busyTimeout to be ignored.

The fix normalizes string config values when they are assigned to typed connection properties, and also types SQLite3\Connection::$busyTimeout as ?int so it behaves consistently. This is done in BaseConnection, where the real destination type is known, rather than trying to guess types for null values in config arrays.

Fixes #10021

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value (without duplication)
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@michalsn michalsn added bug Verified issues on the current code behavior or pull requests that will fix them breaking change Pull requests that may break existing functionalities labels Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change Pull requests that may break existing functionalities bug Verified issues on the current code behavior or pull requests that will fix them

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Setting up via .env does not support typing

1 participant