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

Add StringExpression with collation support #15040

Merged
merged 1 commit into from
Oct 12, 2020
Merged

Conversation

othercorey
Copy link
Member

@othercorey othercorey commented Oct 10, 2020

Refs #14546

Query::newString() helps simplify code instead of having to called new StringExpression everywhere.

If we want to support changing the collation of columns in an expression, that should be done through IdentifierExpression.

@othercorey othercorey added this to the 4.2.0 milestone Oct 10, 2020
@othercorey othercorey marked this pull request as draft October 10, 2020 03:59
@othercorey othercorey force-pushed the string-expression branch 2 times, most recently from daa7fec to 3bd087e Compare October 10, 2020 04:24
@othercorey othercorey marked this pull request as ready for review October 10, 2020 04:25
@othercorey othercorey force-pushed the string-expression branch 2 times, most recently from 14030ae to 25419f9 Compare October 11, 2020 08:34
{
$collation = $expression->getCollation();
if ($collation) {
$expression->setCollation('"' . trim($collation, '"') . '"');
Copy link
Member Author

Choose a reason for hiding this comment

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

The trim() works around a design flaw where expressions are transformed every time sql() is called. I don't know how to fix that in 4.2.

@othercorey othercorey force-pushed the string-expression branch 5 times, most recently from b4b52f9 to 71cab62 Compare October 11, 2020 09:53
src/Database/Query.php Outdated Show resolved Hide resolved
@othercorey othercorey force-pushed the string-expression branch 2 times, most recently from 680c5b0 to 3636673 Compare October 12, 2020 05:11
@othercorey othercorey merged commit f9f30e4 into 4.next Oct 12, 2020
@othercorey othercorey deleted the string-expression branch October 12, 2020 06:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants