Class SqlSegment
Represents a section of a SQL statement, such as SELECT columns or a WHERE clause.
public sealed class SqlSegment
- Inheritance
-
SqlSegment
- Inherited Members
- Extension Methods
Properties
IsEmpty
Gets a value indicating whether the segment contains any parts.
public bool IsEmpty { get; }
Property Value
Name
Gets the name of the segment.
public string Name { get; }
Property Value
Subqueries
Gets the subqueries found in the segment.
public IEnumerable<SqlStatement> Subqueries { get; }
Property Value
Methods
AddCommaSeparatedElement(string)
Appends a comma-separated element to the segment, inserting a comma when required.
public void AddCommaSeparatedElement(string sql)
Parameters
sqlstringThe SQL snippet representing the new element.
AddConjunction(string, string)
Appends a logical conjunction to the segment followed by an expression.
public void AddConjunction(string conjunction, string expression)
Parameters
conjunctionstringThe conjunction keyword such as AND or OR.
expressionstringThe expression to append.
AddRaw(string)
Appends raw SQL tokens to the segment.
public void AddRaw(string sql)
Parameters
sqlstringThe SQL snippet to append.
ToSql()
Builds the SQL text represented by the segment.
public string ToSql()
Returns
- string
The SQL string representing the segment.