Class SqlDeleteStatement
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
targetSqlSegmentThe DELETE target segment when explicitly stated.
fromSqlSegmentThe FROM segment.
usingSqlSegmentThe USING segment when supported by the dialect.
whereSqlSegmentThe WHERE segment.
outputSqlSegmentThe OUTPUT segment.
returningSqlSegmentThe RETURNING segment.
withClauseWithClauseOptional CTE definitions.
Properties
DeletePart
Gets the DELETE clause represented as a typed part when present.
public DeletePart? DeletePart { get; }
Property Value
From
Gets the FROM segment.
public SqlSegment From { get; }
Property Value
FromPart
Gets the FROM clause represented as a typed part.
public FromPart FromPart { get; }
Property Value
Output
Gets the OUTPUT segment when present.
public SqlSegment? Output { get; }
Property Value
Returning
Gets the RETURNING segment when present.
public SqlSegment? Returning { get; }
Property Value
Target
Gets the optional target segment explicitly referenced after DELETE.
public SqlSegment? Target { get; }
Property Value
Using
Gets the USING segment when present.
public SqlSegment? Using { get; }
Property Value
Where
Gets the WHERE segment when present.
public SqlSegment? Where { get; }
Property Value
WherePart
Gets the WHERE clause represented as a typed part when present.
public WherePart? WherePart { get; }
Property Value
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.