Class SapHanaSqlExpressionConvertVisitor
- Namespace
- LinqToDB.Internal.DataProvider.SapHana
- Assembly
- linq2db.dll
public class SapHanaSqlExpressionConvertVisitor : SqlExpressionConvertVisitor
- Inheritance
-
objectSapHanaSqlExpressionConvertVisitor
- Inherited Members
- Extension Methods
Constructors
SapHanaSqlExpressionConvertVisitor(bool)
public SapHanaSqlExpressionConvertVisitor(bool allowModify)
Parameters
allowModifybool
Properties
CanLowerIntervalDifference
Whether an elapsed date difference can be lowered to a value here.
public override bool CanLowerIntervalDifference { get; }
Property Value
Remarks
Declared beside the lowering it describes, and read by the member translator through
ITranslationContext.ProviderFlags. The translator has to ask before it builds anything, because
a difference it does not build stays an ordinary .NET subtraction and is computed on materialisation -
and by the time this visitor runs, the read expression is already bound to its columns, so there is no
going back.
ConcatRequiresExplicitStringCast
When true (default), ConvertConcat(SqlConcatExpression) wraps every non-string
operand in an explicit CAST(... AS VARCHAR(N)) before adding it to the concat chain.
Required for providers whose concat operator is + (SQL Server pre-2025, SqlCe,
Access) — SQL-standard data-type precedence would otherwise try to coerce
string operands to the non-string side's type. Most providers whose final concat operator
is || (PostgreSQL / Oracle / SQLite / SAP HANA / DuckDB / Firebird / DB2 / Informix /
SQL Server 2025+) or CONCAT(...) function (MySQL / ClickHouse) auto-coerce
non-string operands and override this to false for cleaner SQL.
Sybase ASE is the exception: it emits || but keeps this true,
since ASE requires an explicit convert() for non-character operands under both
+ and ||.
protected override bool ConcatRequiresExplicitStringCast { get; }
Property Value
LikeCharactersToEscape
Characters with special meaning in LIKE predicate (defined by LikeCharactersToEscape) that should be escaped to be used as matched character.
Default: ["%", "_", "?", "*", "#", "[", "]"].
public override string[] LikeCharactersToEscape { get; }
Property Value
- string[]
SupportsDistinctAsExistsIntersect
protected override bool SupportsDistinctAsExistsIntersect { get; }
Property Value
Methods
ConvertSqlBinaryExpression(SqlBinaryExpression)
public override IQueryElement ConvertSqlBinaryExpression(SqlBinaryExpression element)
Parameters
elementSqlBinaryExpression
Returns
ConvertSqlUnaryExpression(SqlUnaryExpression)
public override ISqlExpression ConvertSqlUnaryExpression(SqlUnaryExpression element)
Parameters
elementSqlUnaryExpression
Returns
ElapsedTicks(SqlIntervalDifferenceExpression)
NANO100_BETWEEN counts hundred-nanosecond units, which is a tick and is also what a SAP HANA
timestamp stores, so the elapsed count needs no scaling and loses nothing.
protected override ISqlExpression? ElapsedTicks(SqlIntervalDifferenceExpression element)
Parameters
elementSqlIntervalDifferenceExpression
Returns
IsWindowOrderByRequired(SqlExtendedFunction)
feature not supported: Function must have ORDER BY clause - for every ranking function except
ROW_NUMBER, which SAP HANA is happy to leave unordered, and for the five that read a neighbouring
row. A frame needs one too (Window functions must have ORDER BY clause); an unframed aggregate
does not. NTH_VALUE belongs here and nowhere else - Oracle and DB2 both execute
NTH_VALUE(x, 2) OVER () without complaint.
protected override bool IsWindowOrderByRequired(SqlExtendedFunction func)
Parameters
funcSqlExtendedFunction
Returns
WrapColumnExpression(ISqlExpression)
protected override ISqlExpression WrapColumnExpression(ISqlExpression expr)
Parameters
exprISqlExpression