Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed string type casting/coercion from where_in methods #650

Merged

Conversation

stoutput
Copy link
Contributor

@stoutput stoutput commented May 5, 2022

Masonite should not cast args to strings when compiling SQL, or when checking if some data exists in a collection. Rather it should use the raw data that was passed (where() already does this), and not make assumptions about what kind of data it is. Special cases should be handled manually, such as numeric strings matching integers.

This allows for using data such as bytes objects as args to where_in clauses, which will now correctly match against all database-supported data types.

This may break some callers (that expect string coercion), so it should probably be considered backward-incompatible.

Copy link
Member

@josephmancuso josephmancuso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM and all tests are passing 👍

@josephmancuso josephmancuso changed the title Remove string type casting/coercion from where_in methods Fixed string type casting/coercion from where_in methods May 5, 2022
@josephmancuso josephmancuso merged commit 38acd83 into MasoniteFramework:2.0 May 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants