Table of Contents

Class SqlDeleteStatement

Namespace
Utils.Data.Sql
Assembly
Utils.Data.dll

Represents a parsed DELETE statement.

public sealed class SqlDeleteStatement : SqlStatement
Inheritance
SqlDeleteStatement
Inherited Members
Extension Methods

Constructors

SqlDeleteStatement(SqlSegment?, SqlSegment, SqlSegment?, SqlSegment?, SqlSegment?, SqlSegment?, WithClause?)

Initializes a new instance of the SqlDeleteStatement class.

public SqlDeleteStatement(SqlSegment? target, SqlSegment from, SqlSegment? @using, SqlSegment? where, SqlSegment? output, SqlSegment? returning, WithClause? withClause)

Parameters

target SqlSegment

The DELETE target segment when explicitly stated.

from SqlSegment

The FROM segment.

using SqlSegment

The USING segment when supported by the dialect.

where SqlSegment

The WHERE segment.

output SqlSegment

The OUTPUT segment.

returning SqlSegment

The RETURNING segment.

withClause WithClause

Optional CTE definitions.

Properties

DeletePart

Gets the DELETE clause represented as a typed part when present.

public DeletePart? DeletePart { get; }

Property Value

DeletePart

From

Gets the FROM segment.

public SqlSegment From { get; }

Property Value

SqlSegment

FromPart

Gets the FROM clause represented as a typed part.

public FromPart FromPart { get; }

Property Value

FromPart

Output

Gets the OUTPUT segment when present.

public SqlSegment? Output { get; }

Property Value

SqlSegment

Returning

Gets the RETURNING segment when present.

public SqlSegment? Returning { get; }

Property Value

SqlSegment

Target

Gets the optional target segment explicitly referenced after DELETE.

public SqlSegment? Target { get; }

Property Value

SqlSegment

Using

Gets the USING segment when present.

public SqlSegment? Using { get; }

Property Value

SqlSegment

Where

Gets the WHERE segment when present.

public SqlSegment? Where { get; }

Property Value

SqlSegment

WherePart

Gets the WHERE clause represented as a typed part when present.

public WherePart? WherePart { get; }

Property Value

WherePart

Methods

BuildSql()

Builds the canonical inline SQL representation of the statement.

protected override string BuildSql()

Returns

string

The inline SQL string representing the statement.

EnsureOutputSegment()

Ensures the OUTPUT segment exists and returns it.

public SqlSegment EnsureOutputSegment()

Returns

SqlSegment

The existing or newly created OUTPUT segment.

EnsureReturningSegment()

Ensures the RETURNING segment exists and returns it.

public SqlSegment EnsureReturningSegment()

Returns

SqlSegment

The existing or newly created RETURNING segment.

EnsureTargetSegment()

Ensures the DELETE target segment exists and returns it.

public SqlSegment EnsureTargetSegment()

Returns

SqlSegment

The existing or newly created target segment.

EnsureUsingSegment()

Ensures the USING segment exists and returns it.

public SqlSegment EnsureUsingSegment()

Returns

SqlSegment

The existing or newly created USING segment.

EnsureWhereSegment()

Ensures the WHERE segment exists and returns it.

public SqlSegment EnsureWhereSegment()

Returns

SqlSegment

The existing or newly created WHERE segment.