|
|
@ -9,31 +9,33 @@ namespace Connected.Data.Sql;
|
|
|
|
internal sealed class TSqlLinguist : Linguist
|
|
|
|
internal sealed class TSqlLinguist : Linguist
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
public TSqlLinguist(ExpressionCompilationContext context, TSqlLanguage language, Translator translator)
|
|
|
|
public TSqlLinguist(ExpressionCompilationContext context, TSqlLanguage language, Translator translator)
|
|
|
|
: base(context, language, translator)
|
|
|
|
: base(context, language, translator)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override Expression Translate(Expression expression)
|
|
|
|
public override Expression Translate(Expression expression)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* fix up any order-by's
|
|
|
|
* fix up any order-by's
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
expression = OrderByRewriter.Rewrite(Language, expression);
|
|
|
|
expression = OrderByRewriter.Rewrite(Language, expression);
|
|
|
|
|
|
|
|
|
|
|
|
expression = base.Translate(expression);
|
|
|
|
expression = base.Translate(expression);
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* convert skip/take info into RowNumber pattern
|
|
|
|
* convert skip/take info into RowNumber pattern
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
expression = SkipToRowNumberRewriter.Rewrite(Language, expression);
|
|
|
|
expression = SkipToRowNumberRewriter.Rewrite(Language, expression);
|
|
|
|
|
|
|
|
/*
|
|
|
|
expression = WhereClauseRewriter.Rewrite(Context, expression);
|
|
|
|
* fix up any order-by's we may have changed
|
|
|
|
|
|
|
|
*/
|
|
|
|
return expression;
|
|
|
|
expression = OrderByRewriter.Rewrite(Language, expression);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public override string Format(Expression expression)
|
|
|
|
return expression;
|
|
|
|
{
|
|
|
|
}
|
|
|
|
return TSqlFormatter.Format(Context, expression, Language);
|
|
|
|
|
|
|
|
}
|
|
|
|
public override string Format(Expression expression)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return TSqlFormatter.Format(Context, expression, Language);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|