Normalize parameter binding and update API type handling#4
Merged
bernard-ng merged 3 commits intomainfrom Mar 17, 2026
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This pull request introduces a new release (v1.1.2) with two major improvements: it standardizes the return value of single-row fetch methods (
fetchNumeric(),fetchAssociative(), andfetchOne()) to returnundefinedinstead offalsewhen no row is available, and it normalizes bound query parameters so thatundefinedis treated as SQLNULLbefore reaching the driver. These changes improve consistency across drivers, prevent binding errors (especially with MySQL), and align the codebase with modern JavaScript/TypeScript conventions. The updates are reflected throughout the implementation, tests, and metadata-provider integrations.Fetch methods contract and test alignment:
fetchNumeric(),fetchAssociative(), andfetchOne()inResult,Connection,QueryBuilder, portability wrappers, and all bundled drivers to returnundefinedinstead offalsewhen no row is available. All relevant unit tests and metadata-provider integrations were updated to expectundefinedas the sentinel value. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21]Parameter normalization and binding improvements:
undefinedis converted to SQLNULL(null) before binding to driver statements, preventing errors (notably withmysql2) and ensuring consistency between positional and named parameter flows. [1] [2] [3]Versioning and documentation:
1.1.2and updated theCHANGELOG.mdto document these changes. [1] [2]