C# Class Hd.QueryExtensions.Render.MySqlRenderer

Renderer for MySql
Use MySqlRenderer to render SQL statements for MySql database. This version of Sql.Net has been tested with MySql 4
Inheritance: SqlOmRenderer
Mostrar archivo Open project: TargetProcess/Tp.HelpDesk

Public Methods

Method Description
MySqlRenderer ( ) : System

Creates a new MySqlRenderer

RenderPage ( int pageIndex, int pageSize, int totalRowCount, SelectQuery query ) : string

Renders a SELECT statement which a result-set page

Parameter totalRowCount is ignored.

RenderRowCount ( SelectQuery query ) : string

Renders a row count SELECT statement.

Renders a SQL statement which returns a result set with one row and one cell which contains the number of rows query can generate. The generated statement will work nicely with System.Data.IDbCommand.ExecuteScalar method.

RenderSelect ( SelectQuery query ) : string

Renders a SELECT statement

MySql 4.1 does not support GroupByWithCube option. If a query has SelectQuery.GroupByWithCube set an InvalidQueryException exception will be thrown.

Protected Methods

Method Description
IfNull ( StringBuilder builder, SqlExpression expr ) : void

Renders IfNull SqlExpression

Private Methods

Method Description
RenderSelect ( SelectQuery query, bool forRowCount, int offset, int limitRows ) : string

Method Details

IfNull() protected method

Renders IfNull SqlExpression
protected IfNull ( StringBuilder builder, SqlExpression expr ) : void
builder StringBuilder
expr SqlExpression
return void

MySqlRenderer() public method

Creates a new MySqlRenderer
public MySqlRenderer ( ) : System
return System

RenderPage() public method

Renders a SELECT statement which a result-set page
Parameter totalRowCount is ignored.
public RenderPage ( int pageIndex, int pageSize, int totalRowCount, SelectQuery query ) : string
pageIndex int The zero based index of the page to be returned
pageSize int The size of a page
totalRowCount int Total number of rows the query would yeild if not paged
query SelectQuery Query definition to apply paging on
return string

RenderRowCount() public method

Renders a row count SELECT statement.
Renders a SQL statement which returns a result set with one row and one cell which contains the number of rows query can generate. The generated statement will work nicely with System.Data.IDbCommand.ExecuteScalar method.
public RenderRowCount ( SelectQuery query ) : string
query SelectQuery Query definition to count rows for
return string

RenderSelect() public method

Renders a SELECT statement
MySql 4.1 does not support GroupByWithCube option. If a query has SelectQuery.GroupByWithCube set an InvalidQueryException exception will be thrown.
public RenderSelect ( SelectQuery query ) : string
query SelectQuery Query definition
return string