Table of Contents

Class TranslationProviderFlags

Namespace
LinqToDB.Linq.Translation
Assembly
linq2db.dll

Read-only, translation-relevant subset of the provider's SqlProviderFlags, exposed to member translators via ProviderFlags. Only the flags member translators need are surfaced here, rather than the whole SqlProviderFlags.

public sealed class TranslationProviderFlags
Inheritance
object
TranslationProviderFlags
Extension Methods

Constructors

TranslationProviderFlags(NullsDefaultOrdering, bool)

Initializes a new TranslationProviderFlags.

public TranslationProviderFlags(NullsDefaultOrdering defaultNullsOrdering, bool isNullsOrderingSupported)

Parameters

defaultNullsOrdering NullsDefaultOrdering

The provider's natural NULL placement when no NULLS FIRST/NULLS LAST is specified.

isNullsOrderingSupported bool

Whether the provider supports the NULLS FIRST/NULLS LAST keyword in ORDER BY.

TranslationProviderFlags(NullsDefaultOrdering, bool, bool, bool, bool, SqlIntervalUnit, bool)

Initializes a new TranslationProviderFlags.

public TranslationProviderFlags(NullsDefaultOrdering defaultNullsOrdering, bool isNullsOrderingSupported, bool canLowerIntervalDifference, bool canLowerIntervalPart, bool canLowerIntervalShift, SqlIntervalUnit intervalResolution = SqlIntervalUnit.Tick, bool canMeasureDifferenceInTicks = true)

Parameters

defaultNullsOrdering NullsDefaultOrdering

The provider's natural NULL placement when no NULLS FIRST/NULLS LAST is specified.

isNullsOrderingSupported bool

Whether the provider supports the NULLS FIRST/NULLS LAST keyword in ORDER BY.

canLowerIntervalDifference bool

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

canLowerIntervalPart bool

Whether a member of an elapsed date difference can be lowered.

canLowerIntervalShift bool

Whether a date shifted by an interval can be lowered.

intervalResolution SqlIntervalUnit

The finest unit the provider can resolve when measuring elapsed time.

canMeasureDifferenceInTicks bool

Whether an elapsed date difference can become a tick count.

Properties

CanLowerIntervalDifference

Whether an elapsed date difference can be lowered to a value. Answered by the provider's SqlExpressionConvertVisitor, which owns the lowering and documents the contract.

public bool CanLowerIntervalDifference { get; }

Property Value

bool

CanLowerIntervalPart

Whether a member of an elapsed date difference can be lowered. Separate from CanLowerIntervalDifference because a provider may have only this half.

public bool CanLowerIntervalPart { get; }

Property Value

bool

CanLowerIntervalShift

Whether a date shifted by an interval can be lowered. Read for a shift by a declared duration only: that amount is real and nothing later removes it, so a provider that cannot spend one says so while the expression is still being built and leaves a projection free to fall back to .NET. A shift by a computed difference is built regardless, because it may cancel against the difference it came from and ask the provider for nothing at all.

public bool CanLowerIntervalShift { get; }

Property Value

bool

CanMeasureDifferenceInTicks

Whether an elapsed date difference can become a tick count. Where it cannot, a total asked for in a unit finer than IntervalResolution has nowhere to come from, so the translator declines to build it and leaves the member to .NET rather than letting the SQL builder fail the whole query. A total is otherwise built: a coarser measurement quantises one without making it meaningless.

public bool CanMeasureDifferenceInTicks { get; }

Property Value

bool

DefaultNullsOrdering

The provider's natural NULL placement when no NULLS FIRST/NULLS LAST is specified.

public NullsDefaultOrdering DefaultNullsOrdering { get; }

Property Value

NullsDefaultOrdering

IntervalResolution

The finest unit the provider can resolve when measuring elapsed time. A component asked for in a finer unit is identically zero rather than merely imprecise, so the translator declines to build it and leaves the member to .NET.

public SqlIntervalUnit IntervalResolution { get; }

Property Value

SqlIntervalUnit

IsNullsOrderingSupported

Whether the provider supports the NULLS FIRST/NULLS LAST keyword in ORDER BY.

public bool IsNullsOrderingSupported { get; }

Property Value

bool