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

Query cleanup #17130

Merged
merged 2 commits into from
Aug 13, 2019
Merged

Query cleanup #17130

merged 2 commits into from
Aug 13, 2019

Conversation

smitpatel
Copy link
Member

Most of changes are renames and moving files to Internal folder. I will comment on the breaking changes for visibility.

@@ -51,8 +51,6 @@ public ExpressionPrinter()
_encounteredParameters = new List<ParameterExpression>();
}

public virtual IndentedStringBuilder StringBuilder => _stringBuilder;
Copy link
Member Author

Choose a reason for hiding this comment

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

Breaking change. Use API on expression printer directly

@@ -101,18 +99,6 @@ public virtual ExpressionPrinter AppendLines([NotNull] object o, bool skipFinalN
return this;
}

public virtual ExpressionPrinter IncrementIndent()
Copy link
Member Author

Choose a reason for hiding this comment

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

Remove Increment/Decrement Indent. Using Indent and disposable pattern.

@smitpatel
Copy link
Member Author

public class QueryOptimizerFactory : IQueryOptimizerFactory

Moved to Internal as it is factory.


Refers to: src/EFCore/Query/QueryOptimizerFactory.cs:18 in d309c50. [](commit_id = d309c50, deletion_comment = True)

@ajcvickers
Copy link
Member

@smitpatel I intentionally made the factory public because we have dependencies for it, so it makes sense for providers to extend from our factory.

query = new NullComparisonTransformingExpressionVisitor().Visit(query);

return query;
}

protected virtual Expression OptimizeSqlExpression(Expression query) => _sqlExpressionOptimizingExpressionVisitor.Visit(query);
Copy link
Member Author

Choose a reason for hiding this comment

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

All visitors in optimizers are supposed to be internal and exposed via protected methods. This particular visitor moved to .Internal but being used by SqlServer so I have added method to facilitate this for now. We can go over and add methods to call other visitors too in future.

@smitpatel
Copy link
Member Author

@ajcvickers - I will check and revert if necessary.

/// <value>
/// The execution strategy factory.
/// </value>
protected virtual IExecutionStrategyFactory ExecutionStrategyFactory
Copy link
Member Author

Choose a reason for hiding this comment

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

Factory should not be exposing anything from Dependency object.

@@ -11,9 +11,5 @@ public interface IParameterValues
IReadOnlyDictionary<string, object> ParameterValues { get; }

void Add([NotNull] string name, [CanBeNull] object value);

object Remove([NotNull] string name);
Copy link
Member Author

Choose a reason for hiding this comment

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

These APIs were used in old pipeline. Not anymore. It should not affect any provider.

/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
public object GetValue(int index) => _values[index];
Copy link
Member Author

Choose a reason for hiding this comment

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

This was to support include in old pipeline. No longer needed.

@smitpatel
Copy link
Member Author

Added another commit to

  • Remove QueryContextFactory. (Was abstract class which did no specific computation).
  • Providers implement interface directly. Relational factory was also moved to internal. This is provider breaking change. Npgsql should work since it derives from Relational.

@smitpatel
Copy link
Member Author

We will go through breaking changes in API review again. 🎉

@smitpatel smitpatel merged commit 5d43bf5 into release/3.0 Aug 13, 2019
@ghost ghost deleted the smit/somerenames branch August 13, 2019 18:18
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