C# 클래스 ScrewTurn.Wiki.Plugins.SqlCommon.QueryBuilder

A tool for building queries.
파일 보기 프로젝트 열기: mono/ScrewTurnWiki 1 사용 예제들

공개 메소드들

메소드 설명
AndWhere ( string query, string column, WhereOperator op, string parameter ) : string

Adds another WHERE clause to a query.

AndWhere ( string query, string column, WhereOperator op, string parameter, bool openBracket, bool closeBracket ) : string

Adds another WHERE clause to a query.

AndWhere ( string query, string table, string column, WhereOperator op, string parameter ) : string

Adds another WHERE clause to a query.

AndWhere ( string query, string table, string column, WhereOperator op, string parameter, bool openBracket, bool closeBracket ) : string

Adds another WHERE clause to a query.

AppendForBatch ( string query, string secondQuery ) : string

Appends a query to an existing query for batch execution.

DeleteFrom ( string table ) : string

Builds a DELETE FROM query.

GroupBy ( string query, string columns ) : string

Applies a GROUP BY clause to a query.

InsertInto ( string table, string columns, string parameters ) : string

Builds an INSERT INTO query.

NewQuery ( ICommandBuilder builder ) : QueryBuilder

Initializes a new instance of the T:QueryBuilder class.

OrWhere ( string query, string column, WhereOperator op, string parameter ) : string

Adds another WHERE clause to a query.

OrWhere ( string query, string column, WhereOperator op, string parameter, bool openBracket, bool closeBracket ) : string

Adds another WHERE clause to a query.

OrWhere ( string query, string table, string column, WhereOperator op, string parameter ) : string

Adds another WHERE clause to a query.

OrWhere ( string query, string table, string column, WhereOperator op, string parameter, bool openBracket, bool closeBracket ) : string

Adds another WHERE clause to a query.

OrderBy ( string query, string columns, Ordering orderings ) : string

Applies an ORDER BY clause to a query.

QueryBuilder ( ICommandBuilder builder ) : System

Initializes a new instance of the T:QueryBuilder class.

SelectCountFrom ( string table ) : string

Builds a SELECT COUNT(*) query.

SelectFrom ( string table ) : string

Builds a SELECT query.

SelectFrom ( string table, string columns ) : string

Builds a SELECT query.

SelectFrom ( string table, string joinedTable, string tableColumn, string joinedTableColumn, Join join ) : string

Builds a SELECT query with a JOIN clause.

SelectFrom ( string table, string joinedTable, string tableColumn, string joinedTableColumn, Join join, string tableColumns, string joinedTableColumns ) : string

Builds a SELECT query with a JOIN clause.

SelectFrom ( string table, string joinedTable, string tableColumn, string joinedTableColumn, Join join, string tableColumns, string joinedTableColumns, string otherJoinedTable, string otherJoinedTableColumn, Join otherJoin, string otherJoinedTableColumns ) : string

Builds a SELECT query with two JOIN clauses (both on the main table).

Update ( string table, string columns, string parameters ) : string

Builds an UPDATE query.

UpdateIncrement ( string table, string column, int increment ) : string

Builds an UPDATE query that increments the numerical value of a column by one.

Where ( string query, string column, WhereOperator op, string parameter ) : string

Applies a WHERE clause to a query.

Where ( string query, string column, WhereOperator op, string parameter, bool openBracket, bool closeBracket ) : string

Applies a WHERE clause to a query.

Where ( string query, string table, string column, WhereOperator op, string parameter ) : string

Applies a WHERE clause to a query.

Where ( string query, string table, string column, WhereOperator op, string parameter, bool openBracket, bool closeBracket ) : string

Applies a WHERE clause to a query.

WhereIn ( string query, string column, string parameters ) : string

Applies a WHERE clause with IN operator to a query.

WhereIn ( string query, string table, string column, string parameters ) : string

Applies a WHERE clause with IN operator to a query.

WhereNotInSubquery ( string query, string table, string column, string subQuery ) : string

Applies a WHERE NOT IN (subQuery) clause to a query.

비공개 메소드들

메소드 설명
BuildWhereClause ( string table, string column, WhereOperator op, string parameter ) : string

Builds a WHERE clause condition.

BuildWhereInClause ( string table, string column, string parameters ) : string

Builds a WHERE clause with IN operator.

JoinToString ( Join join ) : string

Converts a Join type to its string representation.

OrderingToString ( Ordering ordering ) : string

Converts an ordering to string.

WhereOperatorToString ( WhereOperator op ) : string

Converts a WHERE operator to its corresponding string.

메소드 상세

AndWhere() 공개 메소드

Adds another WHERE clause to a query.
public AndWhere ( string query, string column, WhereOperator op, string parameter ) : string
query string The query.
column string The column subject of the WHERE clause.
op WhereOperator The operator.
parameter string The name of the parameter for the WHERE clause.
리턴 string

AndWhere() 공개 메소드

Adds another WHERE clause to a query.
public AndWhere ( string query, string column, WhereOperator op, string parameter, bool openBracket, bool closeBracket ) : string
query string The query.
column string The column subject of the WHERE clause.
op WhereOperator The operator.
parameter string The name of the parameter for the WHERE clause.
openBracket bool A value indicating whether to open a bracket after the AND.
closeBracket bool A value indicating whether to close a bracket after the clause.
리턴 string

AndWhere() 공개 메소드

Adds another WHERE clause to a query.
public AndWhere ( string query, string table, string column, WhereOperator op, string parameter ) : string
query string The query.
table string The table the column belongs to.
column string The column subject of the WHERE clause.
op WhereOperator The operator.
parameter string The name of the parameter for the WHERE clause.
리턴 string

AndWhere() 공개 메소드

Adds another WHERE clause to a query.
public AndWhere ( string query, string table, string column, WhereOperator op, string parameter, bool openBracket, bool closeBracket ) : string
query string The query.
table string The table the column belongs to.
column string The column subject of the WHERE clause.
op WhereOperator The operator.
parameter string The name of the parameter for the WHERE clause.
openBracket bool A value indicating whether to open a bracket after the AND.
closeBracket bool A value indicating whether to close a bracket after the clause.
리턴 string

AppendForBatch() 공개 메소드

Appends a query to an existing query for batch execution.
public AppendForBatch ( string query, string secondQuery ) : string
query string The query.
secondQuery string The second query.
리턴 string

DeleteFrom() 공개 메소드

Builds a DELETE FROM query.
public DeleteFrom ( string table ) : string
table string The table.
리턴 string

GroupBy() 공개 메소드

Applies a GROUP BY clause to a query.
public GroupBy ( string query, string columns ) : string
query string The query.
columns string The columns to group by.
리턴 string

InsertInto() 공개 메소드

Builds an INSERT INTO query.
public InsertInto ( string table, string columns, string parameters ) : string
table string The destination table.
columns string The columns names.
parameters string The parameters names.
리턴 string

NewQuery() 공개 정적인 메소드

Initializes a new instance of the T:QueryBuilder class.
public static NewQuery ( ICommandBuilder builder ) : QueryBuilder
builder ICommandBuilder The command builder.
리턴 QueryBuilder

OrWhere() 공개 메소드

Adds another WHERE clause to a query.
public OrWhere ( string query, string column, WhereOperator op, string parameter ) : string
query string The query.
column string The column subject of the WHERE clause.
op WhereOperator The operator.
parameter string The name of the parameter for the WHERE clause.
리턴 string

OrWhere() 공개 메소드

Adds another WHERE clause to a query.
public OrWhere ( string query, string column, WhereOperator op, string parameter, bool openBracket, bool closeBracket ) : string
query string The query.
column string The column subject of the WHERE clause.
op WhereOperator The operator.
parameter string The name of the parameter for the WHERE clause.
openBracket bool A value indicating whether to open a bracket after the OR.
closeBracket bool A value indicating whether to close a bracket after the clause.
리턴 string

OrWhere() 공개 메소드

Adds another WHERE clause to a query.
public OrWhere ( string query, string table, string column, WhereOperator op, string parameter ) : string
query string The query.
table string The table the column belongs to.
column string The column subject of the WHERE clause.
op WhereOperator The operator.
parameter string The name of the parameter for the WHERE clause.
리턴 string

OrWhere() 공개 메소드

Adds another WHERE clause to a query.
public OrWhere ( string query, string table, string column, WhereOperator op, string parameter, bool openBracket, bool closeBracket ) : string
query string The query.
table string The table the column belongs to.
column string The column subject of the WHERE clause.
op WhereOperator The operator.
parameter string The name of the parameter for the WHERE clause.
openBracket bool A value indicating whether to open a bracket after the AND.
closeBracket bool A value indicating whether to close a bracket after the clause.
리턴 string

OrderBy() 공개 메소드

Applies an ORDER BY clause to a query.
public OrderBy ( string query, string columns, Ordering orderings ) : string
query string The query.
columns string The columns to order by.
orderings Ordering The ordering directions for each column.
리턴 string

QueryBuilder() 공개 메소드

Initializes a new instance of the T:QueryBuilder class.
public QueryBuilder ( ICommandBuilder builder ) : System
builder ICommandBuilder The command builder.
리턴 System

SelectCountFrom() 공개 메소드

Builds a SELECT COUNT(*) query.
public SelectCountFrom ( string table ) : string
table string The table.
리턴 string

SelectFrom() 공개 메소드

Builds a SELECT query.
public SelectFrom ( string table ) : string
table string The table.
리턴 string

SelectFrom() 공개 메소드

Builds a SELECT query.
public SelectFrom ( string table, string columns ) : string
table string The table.
columns string The columns to select.
리턴 string

SelectFrom() 공개 메소드

Builds a SELECT query with a JOIN clause.
public SelectFrom ( string table, string joinedTable, string tableColumn, string joinedTableColumn, Join join ) : string
table string The main table.
joinedTable string The joined table.
tableColumn string The main table column to join.
joinedTableColumn string The joined table column to join.
join Join The JOIN type.
리턴 string

SelectFrom() 공개 메소드

Builds a SELECT query with a JOIN clause.
public SelectFrom ( string table, string joinedTable, string tableColumn, string joinedTableColumn, Join join, string tableColumns, string joinedTableColumns ) : string
table string The min table.
joinedTable string The joined table.
tableColumn string The main table column to join.
joinedTableColumn string The joined table column to join.
join Join The JOIN type.
tableColumns string The main table columns to select.
joinedTableColumns string The joined table columns to select.
리턴 string

SelectFrom() 공개 메소드

Builds a SELECT query with two JOIN clauses (both on the main table).
public SelectFrom ( string table, string joinedTable, string tableColumn, string joinedTableColumn, Join join, string tableColumns, string joinedTableColumns, string otherJoinedTable, string otherJoinedTableColumn, Join otherJoin, string otherJoinedTableColumns ) : string
table string The main table.
joinedTable string The joined table.
tableColumn string The main table column to join.
joinedTableColumn string The joined table column to join.
join Join The join.
tableColumns string The main table columns to select.
joinedTableColumns string The joined table columns to select.
otherJoinedTable string The other joined table.
otherJoinedTableColumn string The other joined table column to join.
otherJoin Join The join.
otherJoinedTableColumns string The other joined table columns to select.
리턴 string

Update() 공개 메소드

Builds an UPDATE query.
public Update ( string table, string columns, string parameters ) : string
table string The table.
columns string The columns to update.
parameters string The parameters.
리턴 string

UpdateIncrement() 공개 메소드

Builds an UPDATE query that increments the numerical value of a column by one.
public UpdateIncrement ( string table, string column, int increment ) : string
table string The table.
column string The column to update.
increment int The increment or decrement value.
리턴 string

Where() 공개 메소드

Applies a WHERE clause to a query.
public Where ( string query, string column, WhereOperator op, string parameter ) : string
query string The query.
column string The column subject of the WHERE clause.
op WhereOperator The operator.
parameter string The name of the parameter for the WHERE clause.
리턴 string

Where() 공개 메소드

Applies a WHERE clause to a query.
public Where ( string query, string column, WhereOperator op, string parameter, bool openBracket, bool closeBracket ) : string
query string The query.
column string The column subject of the WHERE clause.
op WhereOperator The operator.
parameter string The name of the parameter for the WHERE clause.
openBracket bool A value indicating whether to open a bracket after the WHERE.
closeBracket bool A value indicating whether to close a bracket after the clause.
리턴 string

Where() 공개 메소드

Applies a WHERE clause to a query.
public Where ( string query, string table, string column, WhereOperator op, string parameter ) : string
query string The query.
table string The table the column belongs to.
column string The column subject of the WHERE clause.
op WhereOperator The operator.
parameter string The name of the parameter for the WHERE clause.
리턴 string

Where() 공개 메소드

Applies a WHERE clause to a query.
public Where ( string query, string table, string column, WhereOperator op, string parameter, bool openBracket, bool closeBracket ) : string
query string The query.
table string The table the column belongs to.
column string The column subject of the WHERE clause.
op WhereOperator The operator.
parameter string The name of the parameter for the WHERE clause.
openBracket bool A value indicating whether to open a bracket after the WHERE.
closeBracket bool A value indicating whether to close a bracket after the clause.
리턴 string

WhereIn() 공개 메소드

Applies a WHERE clause with IN operator to a query.
public WhereIn ( string query, string column, string parameters ) : string
query string The query.
column string The column subject of the WHERE clause.
parameters string The names of the parameters in the IN set.
리턴 string

WhereIn() 공개 메소드

Applies a WHERE clause with IN operator to a query.
public WhereIn ( string query, string table, string column, string parameters ) : string
query string The query.
table string The table the column belongs to.
column string The column subject of the WHERE clause.
parameters string The names of the parameters in the IN set.
리턴 string

WhereNotInSubquery() 공개 메소드

Applies a WHERE NOT IN (subQuery) clause to a query.
public WhereNotInSubquery ( string query, string table, string column, string subQuery ) : string
query string The query.
table string The table the column belongs to.
column string The column.
subQuery string The subQuery.
리턴 string