Table of Contents

Interface IDmlService

Namespace
LinqToDB.Internal.DataProvider
Assembly
linq2db.dll

Provider-specific DML mechanics that can't be expressed through SQL generation alone: command-scenario construction (how one logical operation maps to ordered execution steps), physical grouping of those steps, and "table not found" detection. Resolved from the data context's service provider by query runners that execute DML.

public interface IDmlService
Extension Methods

Methods

BuildCommandScenario(SqlStatement, SqlProviderFlags, ISqlExpressionFactory)

Builds the logical SqlCommandScenario (ordered steps + outcome) for statement. The base implementation always produces a scenario (a single-step one for a self-contained statement); the runner treats a null result as a contract error. Use factory to construct any synthetic statements a step needs (e.g. an identity-retrieval SELECT).

SqlCommandScenario? BuildCommandScenario(SqlStatement statement, SqlProviderFlags flags, ISqlExpressionFactory factory)

Parameters

statement SqlStatement
flags SqlProviderFlags
factory ISqlExpressionFactory

Returns

SqlCommandScenario

IsTableNotFoundException(Exception)

Returns true if the given exception indicates the target table does not exist. Used by DropTable to decide whether a "not exists" suppression request should swallow a given error.

bool IsTableNotFoundException(Exception exception)

Parameters

exception Exception

Returns

bool

PlanScenario(SqlCommandScenario, SqlProviderFlags)

Plans how a scenario's steps map to physical command groups (round-trips): contiguous non-gated steps may be combined into one command when IsMultiStatementBatchSupported is set.

SqlCommandGroupPlan PlanScenario(SqlCommandScenario scenario, SqlProviderFlags flags)

Parameters

scenario SqlCommandScenario
flags SqlProviderFlags

Returns

SqlCommandGroupPlan