refactor(query): extract shared Strata.SqlTools.Query model project
Moves the byte-identical 19-file ExpressionFactory/Query tree (duplicated across Snowflake and SqlServer) into the new Strata.SqlTools.Query project under the flat namespace Strata.SqlTools.Query. Both dialect projects now reference the shared project; the Snowflake copies are deleted. Also folds in the IDE0028 fix on CalculationFilterGroup.GetValidFilters (collection expression []), which resolves both new-code IDE0028 smells in one place now that there is a single copy. Eliminates the 63 new duplicate lines flagged on the PR and removes the largest contributor to the project's 11.1% duplication density. No behavioral change: the moved types are identical to the originals. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
c5a4a4b02b
commit
5cb32d2311
@@ -0,0 +1,30 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Strata.SqlTools.Query;
|
||||
|
||||
public enum LogicalOperator
|
||||
{
|
||||
[Display(Name = "and")]
|
||||
And,
|
||||
[Display(Name = "or")]
|
||||
Or
|
||||
}
|
||||
|
||||
public static class LogicalOperatorExtensions
|
||||
{
|
||||
public static string ToSql(this LogicalOperator logicalOperator, bool withSpaces = true)
|
||||
{
|
||||
var sql = "";
|
||||
switch (logicalOperator)
|
||||
{
|
||||
case LogicalOperator.And:
|
||||
sql = "and";
|
||||
break;
|
||||
case LogicalOperator.Or:
|
||||
sql = "or";
|
||||
break;
|
||||
}
|
||||
|
||||
return withSpaces ? $" {sql} " : sql;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user