Table of Contents

Class SybaseSqlExpressionConvertVisitor

Namespace
LinqToDB.Internal.DataProvider.Sybase
Assembly
linq2db.dll
public class SybaseSqlExpressionConvertVisitor : SqlExpressionConvertVisitor
Inheritance
object
SybaseSqlExpressionConvertVisitor
Inherited Members
Extension Methods

Constructors

SybaseSqlExpressionConvertVisitor(bool)

public SybaseSqlExpressionConvertVisitor(bool allowModify)

Parameters

allowModify bool

Properties

CanLowerIntervalDifference

Whether an elapsed date difference can be lowered to a value here.

public override bool CanLowerIntervalDifference { get; }

Property Value

bool

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.

FinestDateUnit

DATEDIFF counts milliseconds, finer than the three-and-a-third that an ASE datetime stores, so the remainder that completes an elapsed count is exact.

protected override SqlIntervalUnit? FinestDateUnit { get; }

Property Value

SqlIntervalUnit?

IntervalResolution

The measurement stops there as well, so a component asked for below the millisecond is identically zero rather than merely imprecise - the count it is taken from was rounded to a coarser unit first.

public override SqlIntervalUnit IntervalResolution { get; }

Property Value

SqlIntervalUnit

Remarks

Declared for the reason SQLite declares the same limit: declining while the expression is still being built leaves the member to .NET, which holds both dates and answers exactly. The three-and-a-third millisecond step above is what makes a stored difference carry a sub-millisecond part at all, so answering zero would be a wrong number rather than a coarse one.

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[]

Methods

ConvertSqlFunction(SqlFunction)

public override ISqlExpression ConvertSqlFunction(SqlFunction func)

Parameters

func SqlFunction

Returns

ISqlExpression

CountDateBoundaries(SqlIntervalUnit, ISqlExpression, ISqlExpression)

Boundary counting through DATEDIFF, which the tick decomposition turns into elapsed time.

protected override ISqlExpression? CountDateBoundaries(SqlIntervalUnit unit, ISqlExpression start, ISqlExpression end)

Parameters

unit SqlIntervalUnit
start ISqlExpression
end ISqlExpression

Returns

ISqlExpression

Remarks

The count is a 32-bit value, so asking it for milliseconds across more than about twenty-four days overflows. Nothing does: the whole part is counted in days and the millisecond count only ever spans the remainder of one, which is 86,400,000 at most.

ShiftDate(SqlIntervalUnit, ISqlExpression, ISqlExpression)

Shifts a date/time value by a whole number of units - the provider's DATEADD.

protected override ISqlExpression? ShiftDate(SqlIntervalUnit unit, ISqlExpression amount, ISqlExpression date)

Parameters

unit SqlIntervalUnit
amount ISqlExpression
date ISqlExpression

Returns

ISqlExpression

Remarks

Must be exact: the anchor correction in IntervalLowering shifts by a computed count and compares the result against the original, so an approximate shift would produce an off-by-one count.

VisitExistsPredicate(Exists)

protected override IQueryElement VisitExistsPredicate(SqlPredicate.Exists predicate)

Parameters

predicate SqlPredicate.Exists

Returns

IQueryElement

WrapColumnExpression(ISqlExpression)

protected override ISqlExpression WrapColumnExpression(ISqlExpression expr)

Parameters

expr ISqlExpression

Returns

ISqlExpression