Table of Contents

Interface IQueryGenerator

Namespace
FluentCommand.Query.Generators
Assembly
FluentCommand.dll

Defines methods for generating SQL query statements and expressions for various SQL operations.

public interface IQueryGenerator

Methods

AggregateExpression(AggregateExpression)

Builds a SQL aggregate expression (e.g., COUNT, SUM) from the specified AggregateExpression(AggregateExpression).

string AggregateExpression(AggregateExpression aggregateExpression)

Parameters

aggregateExpression AggregateExpression

The AggregateExpression(AggregateExpression) representing the aggregate function.

Returns

string

A SQL aggregate expression string.

BuildDelete(DeleteStatement)

Builds a SQL DELETE statement from the specified DeleteStatement.

string BuildDelete(DeleteStatement deleteStatement)

Parameters

deleteStatement DeleteStatement

The DeleteStatement containing the DELETE statement configuration.

Returns

string

A SQL DELETE statement string.

BuildInsert(InsertStatement)

Builds a SQL INSERT statement from the specified InsertStatement.

string BuildInsert(InsertStatement insertStatement)

Parameters

insertStatement InsertStatement

The InsertStatement containing the INSERT statement configuration.

Returns

string

A SQL INSERT statement string.

BuildOrder(IReadOnlyCollection<SortExpression>)

Builds a SQL ORDER BY clause from the specified collection of SortExpression(SortExpression) objects.

string BuildOrder(IReadOnlyCollection<SortExpression> sortExpressions)

Parameters

sortExpressions IReadOnlyCollection<SortExpression>

A collection of SortExpression(SortExpression) objects representing sort conditions.

Returns

string

A SQL ORDER BY clause string.

BuildSelect(SelectStatement)

Builds a SQL SELECT statement from the specified SelectStatement.

string BuildSelect(SelectStatement selectStatement)

Parameters

selectStatement SelectStatement

The SelectStatement containing the SELECT statement configuration.

Returns

string

A SQL SELECT statement string.

BuildUpdate(UpdateStatement)

Builds a SQL UPDATE statement from the specified UpdateStatement.

string BuildUpdate(UpdateStatement updateStatement)

Parameters

updateStatement UpdateStatement

The UpdateStatement containing the UPDATE statement configuration.

Returns

string

A SQL UPDATE statement string.

BuildWhere(IReadOnlyCollection<WhereExpression>)

Builds a SQL WHERE clause from the specified collection of WhereExpression(WhereExpression) objects.

string BuildWhere(IReadOnlyCollection<WhereExpression> whereExpressions)

Parameters

whereExpressions IReadOnlyCollection<WhereExpression>

A collection of WhereExpression(WhereExpression) objects representing WHERE conditions.

Returns

string

A SQL WHERE clause string.

ColumnExpression(ColumnExpression)

Builds a SQL column expression from the specified ColumnExpression(ColumnExpression).

string ColumnExpression(ColumnExpression columnExpression)

Parameters

columnExpression ColumnExpression

The ColumnExpression(ColumnExpression) representing the column.

Returns

string

A SQL column expression string.

CommentExpression(string)

Builds a SQL comment expression.

string CommentExpression(string comment)

Parameters

comment string

The comment text.

Returns

string

A SQL comment string.

GroupExpression(GroupExpression)

Builds a SQL GROUP BY expression from the specified GroupExpression(GroupExpression).

string GroupExpression(GroupExpression groupExpression)

Parameters

groupExpression GroupExpression

The GroupExpression(GroupExpression) representing the group by condition.

Returns

string

A SQL GROUP BY expression string.

JoinExpression(JoinExpression)

Builds a SQL JOIN expression from the specified JoinExpression(JoinExpression).

string JoinExpression(JoinExpression joinExpression)

Parameters

joinExpression JoinExpression

The JoinExpression(JoinExpression) representing the join operation.

Returns

string

A SQL JOIN expression string.

LimitExpression(LimitExpression)

Builds a SQL LIMIT/OFFSET expression from the specified LimitExpression(LimitExpression).

string LimitExpression(LimitExpression limitExpression)

Parameters

limitExpression LimitExpression

The LimitExpression(LimitExpression) representing the limit and offset.

Returns

string

A SQL LIMIT/OFFSET expression string.

LogicalExpression(IReadOnlyCollection<WhereExpression>, LogicalOperators)

Builds a logical SQL expression (e.g., AND/OR group) from the specified WHERE expressions and logical operator.

string LogicalExpression(IReadOnlyCollection<WhereExpression> whereExpressions, LogicalOperators logicalOperator)

Parameters

whereExpressions IReadOnlyCollection<WhereExpression>

A collection of WhereExpression(WhereExpression) objects representing conditions.

logicalOperator LogicalOperators

The LogicalOperators value to combine the expressions.

Returns

string

A logical SQL expression string.

SortExpression(SortExpression)

Builds a SQL sort expression from the specified SortExpression(SortExpression).

string SortExpression(SortExpression sortExpression)

Parameters

sortExpression SortExpression

The SortExpression(SortExpression) representing the sort condition.

Returns

string

A SQL sort expression string.

TableExpression(TableExpression)

Builds a SQL table expression from the specified TableExpression(TableExpression).

string TableExpression(TableExpression tableExpression)

Parameters

tableExpression TableExpression

The TableExpression(TableExpression) representing the table.

Returns

string

A SQL table expression string.

UpdateExpression(UpdateExpression)

Builds a SQL update expression from the specified UpdateExpression(UpdateExpression).

string UpdateExpression(UpdateExpression updateExpression)

Parameters

updateExpression UpdateExpression

The UpdateExpression(UpdateExpression) representing the update operation.

Returns

string

A SQL update expression string.

WhereExpression(WhereExpression)

Builds a SQL WHERE expression from the specified WhereExpression(WhereExpression).

string WhereExpression(WhereExpression whereExpression)

Parameters

whereExpression WhereExpression

The WhereExpression(WhereExpression) representing the condition.

Returns

string

A SQL WHERE expression string.