fix(sql-mapper/types): enhance null value type support and documentation #2360
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.
For instance, without explicit support for null values in the WhereCondition interface, developers could inadvertently produce queries that do not behave as expected in scenarios involving null. Similarly, lacking clear documentation might lead to inconsistent query formulations or misunderstandings about how null comparisons are conducted in SQL, affecting data retrieval or manipulation tasks.
With these enhancements, the interface now directly accommodates null values, reducing potential for errors and increasing query precision. Improved documentation further aids developers, offering detailed insights into the operation of eq and neq with null, thereby standardizing practices and bolstering the robustness of applications built on our platform.
♻️ (mapper.d.ts): Update WhereCondition interface to allow null values for eq and neq properties
This update introduces the ability to explicitly set null values for the eq and neq properties within the WhereCondition interface. This change promotes greater flexibility and accuracy in query formulation, aligning with SQL standards for null handling.
✨ (api.md): Enhance documentation on null value handling with eq and neq operators in SQL queries
The documentation has been further refined with additional details on how null values are treated when using the eq and neq operators in SQL queries, enhancing understanding and usability for developers.
🔎 Use-case:
Prior to these updates, developers might face ambiguity when setting null values for eq and neq properties or when interpreting documentation regarding null handling in SQL queries. Misinterpretations or misconfigurations could lead to unintended query results or typescript errors.