# \PG\MSF\PoolsMiner

Class Miner

## Summary

Methods
Properties
Constants
__construct()
calcFoundRows()
option()
distinct()
values()
set()
intoColumns()
intoValues()
innerJoin()
join()
leftJoin()
rightJoin()
andWhere()
orWhere()
whereIn()
whereNotIn()
whereBetween()
whereNotBetween()
andHaving()
orHaving()
havingIn()
havingNotIn()
havingBetween()
havingNotBetween()
insertInto()
insert()
replaceInto()
replace()
updateInto()
update()
__toString()
getStatement()
isSelect()
getSelectString()
getOptionsString()
getFromString()
getFrom()
getFromAlias()
getJoinString()
isUpdate()
getUpdate()
getWhereString()
getAutoQuote()
setAutoQuote()
autoQuote()
quote()
getPdoConnection()
setPdoConnection()
getGroupByString()
getHavingString()
getOrderByString()
getLimitString()
isInsert()
getInsertString()
getInsert()
getIntoString()
getSetString()
isReplace()
getReplaceString()
getReplace()
getUpdateString()
isDelete()
getDeleteString()
go()
mergeInto()
mergeSelectInto()
mergeOptionsInto()
select()
mergeFromInto()
from()
mergeJoinInto()
mergeWhereInto()
openWhere()
closeWhere()
where()
mergeGroupByInto()
groupBy()
mergeHavingInto()
openHaving()
closeHaving()
having()
mergeOrderByInto()
orderBy()
mergeLimitInto()
limit()
getLimit()
getLimitOffset()
mergeInsertInto()
mergeSetInto()
mergeReplaceInto()
mergeUpdateInto()
mergeDeleteInto()
delete()
clear()
pdoCommitTrans()
pdoBeginTrans()
pdoRollBackTrans()
pdoQuery()
pdoConnect()
getPlaceholderValues()
getSetPlaceholderValues()
getWherePlaceholderValues()
getHavingPlaceholderValues()
pdoInsertId()
$mysqlPool
INNER_JOIN
LEFT_JOIN
RIGHT_JOIN
LOGICAL_AND
LOGICAL_OR
EQUALS
NOT_EQUALS
LESS_THAN
LESS_THAN_OR_EQUAL
GREATER_THAN
GREATER_THAN_OR_EQUAL
IN
NOT_IN
LIKE
NOT_LIKE
ILIKE
REGEX
NOT_REGEX
BETWEEN
NOT_BETWEEN
IS
IS_NOT
ORDER_BY_ASC
ORDER_BY_DESC
BRACKET_OPEN
BRACKET_CLOSE
pdoExecute()
$activeConfig
N/A
isJoinUnique()
criteria()
orCriteria()
criteriaIn()
criteriaNotIn()
criteriaBetween()
criteriaNotBetween()
getSelectStatement()
getJoinCriteriaUsingPreviousTable()
getCriteriaString()
getInsertStatement()
getReplaceStatement()
getUpdateStatement()
getDeleteStatement()
isDeleteTableFrom()
openCriteria()
closeCriteria()
$PdoConnection
$autoQuote
$option
$select
$insert
$replace
$update
$delete
$set
$from
$join
$where
$groupBy
$having
$orderBy
$limit
$setPlaceholderValues
$wherePlaceholderValues
$havingPlaceholderValues
$isInto
$intoColums
$intoValues
N/A

File
  Pools/Miner.php
Package
  MSF\Pools
Class hierarchy
  \PG\MSF\Pools\Miner
Uses traits
  \PG\AOP\MI

## Tags

None found

## Constants

### INNER_JOIN

    INNER_JOIN

INNER JOIN type.

#

## Tags

None found

### LEFT_JOIN

    LEFT_JOIN

LEFT JOIN type.

#

## Tags

None found

### RIGHT_JOIN

    RIGHT_JOIN

RIGHT JOIN type.

#

## Tags

None found

### LOGICAL_AND

    LOGICAL_AND

AND logical operator.

#

## Tags

None found

### LOGICAL_OR

    LOGICAL_OR

OR logical operator.

#

## Tags

None found

### EQUALS

    EQUALS

Equals comparison operator.

#

## Tags

None found

### NOT_EQUALS

    NOT_EQUALS

Not equals comparison operator.

#

## Tags

None found

### LESS_THAN

    LESS_THAN

Less than comparison operator.

#

## Tags

None found

### LESS_THAN_OR_EQUAL

    LESS_THAN_OR_EQUAL

Less than or equal to comparison operator.

#

## Tags

None found

### GREATER_THAN

    GREATER_THAN

Greater than comparison operator.

#

## Tags

None found

### GREATER_THAN_OR_EQUAL

    GREATER_THAN_OR_EQUAL

Greater than or equal to comparison operator.

#

## Tags

None found

### IN

    IN

IN comparison operator.

#

## Tags

None found

### NOT_IN

    NOT_IN

NOT IN comparison operator.

#

## Tags

None found

### LIKE

    LIKE

LIKE comparison operator.

#

## Tags

None found

### NOT_LIKE

    NOT_LIKE

NOT LIKE comparison operator.

#

## Tags

None found

### ILIKE

    ILIKE

ILIKE comparison operator.

#

## Tags

None found

### REGEX

    REGEX

REGEXP comparison operator.

#

## Tags

None found

### NOT_REGEX

    NOT_REGEX

NOT REGEXP comparison operator.

#

## Tags

None found

### BETWEEN

    BETWEEN

BETWEEN comparison operator.

#

## Tags

None found

### NOT_BETWEEN

    NOT_BETWEEN

NOT BETWEEN comparison operator.

#

## Tags

None found

### IS

    IS

IS comparison operator.

#

## Tags

None found

### IS_NOT

    IS_NOT

IS NOT comparison operator.

#

## Tags

None found

### ORDER_BY_ASC

    ORDER_BY_ASC

Ascending ORDER BY direction.

#

## Tags

None found

### ORDER_BY_DESC

    ORDER_BY_DESC

Descending ORDER BY direction.

#

## Tags

None found

### BRACKET_OPEN

    BRACKET_OPEN

Open bracket for grouping criteria.

#

## Tags

None found

### BRACKET_CLOSE

    BRACKET_CLOSE

Closing bracket for grouping criteria.

#

## Tags

None found

## Properties

### $mysqlPool

    $mysqlPool : \PG\MSF\Pools\MysqlAsynPool

#### Type

\PG\MSF\Pools\MysqlAsynPool — MySQL连接池

#

## Tags

None found

### $activeConfig

    $activeConfig : array

#### Type

array — MySQL连接池配置

#

## Tags

None found

### $PdoConnection

    $PdoConnection : \PDO|null

PDO database connection to use in executing the statement.

#### Type

\PDO|null

#

## Tags

None found

### $autoQuote

    $autoQuote : boolean|null

Whether to automatically escape values.

#### Type

boolean|null

#

## Tags

None found

### $option

    $option : array

Execution options like DISTINCT and SQL_CALC_FOUND_ROWS.

#### Type

array

#

## Tags

None found

### $select

    $select : array

Columns, tables, and expressions to SELECT from.

#### Type

array

#

## Tags

None found

### $insert

    $insert : string

Table to INSERT into.

#### Type

string

#

## Tags

None found

### $replace

    $replace : string

Table to REPLACE into.

#### Type

string

#

## Tags

None found

### $update

    $update : string

Table to UPDATE.

#### Type

string

#

## Tags

None found

### $delete

    $delete : array|true

Tables to DELETE from, or true if deleting from the FROM table.

#### Type

array|true

#

## Tags

None found

### $set

    $set : array

Column values to INSERT, UPDATE, or REPLACE.

#### Type

array

#

## Tags

None found

### $from

    $from : array

Table to select FROM.

#### Type

array

#

## Tags

None found

### $join

    $join : array

JOIN tables and ON criteria.

#### Type

array

#

## Tags

None found

### $where

    $where : array

WHERE criteria.

#### Type

array

#

## Tags

None found

### $groupBy

    $groupBy : array

Columns to GROUP BY.

#### Type

array

#

## Tags

None found

### $having

    $having : array

HAVING criteria.

#### Type

array

#

## Tags

None found

### $orderBy

    $orderBy : array

Columns to ORDER BY.

#### Type

array

#

## Tags

None found

### $limit

    $limit : array

Number of rows to return from offset.

#### Type

array

#

## Tags

None found

### $setPlaceholderValues

    $setPlaceholderValues : array

SET placeholder values.

#### Type

array

#

## Tags

None found

### $wherePlaceholderValues

    $wherePlaceholderValues : array

WHERE placeholder values.

#### Type

array

#

## Tags

None found

### $havingPlaceholderValues

    $havingPlaceholderValues : array

HAVING placeholder values.

#### Type

array

#

## Tags

None found

### $isInto

    $isInto : boolean

InTo

#### Type

boolean

#

## Tags

None found

### $intoColums

    $intoColums : array

into colums

#### Type

array

#

## Tags

None found

### $intoValues

    $intoValues : array

into values

#### Type

array

#

## Tags

None found

## Methods

### __construct()

    __construct(  $mysqlPool = null)

Miner constructor.

#### Parameters

| $mysqlPool |

#

## Tags

None found

### calcFoundRows()

    calcFoundRows() : \PG\MSF\Pools\Miner

Add SQL_CALC_FOUND_ROWS execution option.

#### Returns

\PG\MSF\Pools\Miner

#

## Tags

None found

### option()

    option(string  $option) : \PG\MSF\Pools\Miner

Add an execution option like DISTINCT or SQL_CALC_FOUND_ROWS.

#### Parameters

string | $option | execution option to add

#### Returns

\PG\MSF\Pools\Miner

#

## Tags

None found

### distinct()

    distinct() : \PG\MSF\Pools\Miner

Add DISTINCT execution option.

#### Returns

\PG\MSF\Pools\Miner

#

## Tags

None found

### values()

    values(array  $values) : \PG\MSF\Pools\Miner

Add an array of columns => values to INSERT, UPDATE, or REPLACE.

#### Parameters

array | $values | columns => values

#### Returns

\PG\MSF\Pools\Miner

#

## Tags

None found

### set()

    set(string|array  $column, mixed|null  $value = null, boolean|null  $quote = null) : \PG\MSF\Pools\Miner

Add one or more column values to INSERT, UPDATE, or REPLACE.

#### Parameters

string|array | $column | column name or array of columns => values
mixed|null | $value | optional value for single column
boolean|null | $quote | optional auto-escape value, default to global

#### Returns

\PG\MSF\Pools\Miner

#

## Tags

None found

### intoColumns()

    intoColumns(array  $columns) : $this

配合into使用

#### Parameters

array | $columns |

#### Returns

$this

#

## Tags

None found

### intoValues()

    intoValues(array  $values) : $this

配合into使用

#### Parameters

array | $values |

#### Returns

$this

#

## Tags

None found

### innerJoin()

    innerJoin(string  $table, string|array  $criteria = null, string  $alias = null) : \PG\MSF\Pools\Miner

Add an INNER JOIN table with optional ON criteria.

#### Parameters

string | $table | table name
string|array | $criteria | optional ON criteria
string | $alias | optional alias

#### Returns

\PG\MSF\Pools\Miner

#

## Tags

None found

### join()

    join(string  $table, string|array  $criteria = null, string  $type = self::INNER_JOIN, string  $alias = null) : \PG\MSF\Pools\Miner

Add a JOIN table with optional ON criteria.

#### Parameters

string | $table | table name
string|array | $criteria | optional ON criteria
string | $type | optional type of join, default INNER JOIN
string | $alias | optional alias

#### Returns

\PG\MSF\Pools\Miner

#

## Tags

None found

### leftJoin()

    leftJoin(string  $table, string|array  $criteria = null, string  $alias = null) : \PG\MSF\Pools\Miner

Add a LEFT JOIN table with optional ON criteria.

#### Parameters

string | $table | table name
string|array | $criteria | optional ON criteria
string | $alias | optional alias

#### Returns

\PG\MSF\Pools\Miner

#

## Tags

None found

### rightJoin()

    rightJoin(string  $table, string|array  $criteria = null, string  $alias = null) : \PG\MSF\Pools\Miner

Add a RIGHT JOIN table with optional ON criteria.

#### Parameters

string | $table | table name
string|array | $criteria | optional ON criteria
string | $alias | optional alias

#### Returns

\PG\MSF\Pools\Miner

#

## Tags

None found

### andWhere()

    andWhere(string  $column, mixed  $value, string  $operator = self::EQUALS, boolean|null  $quote = null) : \PG\MSF\Pools\Miner

Add an AND WHERE condition.

#### Parameters

string | $column | colum name
mixed | $value | value
string | $operator | optional comparison operator, default =
boolean|null | $quote | optional auto-escape value, default to global

#### Returns

\PG\MSF\Pools\Miner

#

## Tags

None found

### orWhere()

    orWhere(string  $column, mixed  $value, string  $operator = self::EQUALS, boolean|null  $quote = null) : \PG\MSF\Pools\Miner

Add an OR WHERE condition.

#### Parameters

string | $column | colum name
mixed | $value | value
string | $operator | optional comparison operator, default =
boolean|null | $quote | optional auto-escape value, default to global

#### Returns

\PG\MSF\Pools\Miner

#

## Tags

None found

### whereIn()

    whereIn(string  $column, array  $values, string  $connector = self::LOGICAL_AND, boolean|null  $quote = null) : \PG\MSF\Pools\Miner

Add an IN WHERE condition.

#### Parameters

string | $column | column name
array | $values | values
string | $connector | optional logical connector, default AND
boolean|null | $quote | optional auto-escape value, default to global

#### Returns

\PG\MSF\Pools\Miner

#

## Tags

None found

### whereNotIn()

    whereNotIn(string  $column, array  $values, string  $connector = self::LOGICAL_AND, boolean|null  $quote = null) : \PG\MSF\Pools\Miner

Add a NOT IN WHERE condition.

#### Parameters

string | $column | column name
array | $values | values
string | $connector | optional logical connector, default AND
boolean|null | $quote | optional auto-escape value, default to global

#### Returns

\PG\MSF\Pools\Miner

#

## Tags

None found

### whereBetween()

    whereBetween(string  $column, mixed  $min, mixed  $max, string  $connector = self::LOGICAL_AND, boolean|null  $quote = null) : \PG\MSF\Pools\Miner

Add a BETWEEN WHERE condition.

#### Parameters

string | $column | column name
mixed | $min | minimum value
mixed | $max | maximum value
string | $connector | optional logical connector, default AND
boolean|null | $quote | optional auto-escape value, default to global

#### Returns

\PG\MSF\Pools\Miner

#

## Tags

None found

### whereNotBetween()

    whereNotBetween(string  $column, mixed  $min, mixed  $max, string  $connector = self::LOGICAL_AND, boolean|null  $quote = null) : \PG\MSF\Pools\Miner

Add a NOT BETWEEN WHERE condition.

#### Parameters

string | $column | column name
mixed | $min | minimum value
mixed | $max | maximum value
string | $connector | optional logical connector, default AND
boolean|null | $quote | optional auto-escape value, default to global

#### Returns

\PG\MSF\Pools\Miner

#

## Tags

None found

### andHaving()

    andHaving(string  $column, mixed  $value, string  $operator = self::EQUALS, boolean|null  $quote = null) : \PG\MSF\Pools\Miner

Add an AND HAVING condition.

#### Parameters

string | $column | colum name
mixed | $value | value
string | $operator | optional comparison operator, default =
boolean|null | $quote | optional auto-escape value, default to global

#### Returns

\PG\MSF\Pools\Miner

#

## Tags

None found

### orHaving()

    orHaving(string  $column, mixed  $value, string  $operator = self::EQUALS, boolean|null  $quote = null) : \PG\MSF\Pools\Miner

Add an OR HAVING condition.

#### Parameters

string | $column | colum name
mixed | $value | value
string | $operator | optional comparison operator, default =
boolean|null | $quote | optional auto-escape value, default to global

#### Returns

\PG\MSF\Pools\Miner

#

## Tags

None found

### havingIn()

    havingIn(string  $column, array  $values, string  $connector = self::LOGICAL_AND, boolean|null  $quote = null) : \PG\MSF\Pools\Miner

Add an IN WHERE condition.

#### Parameters

string | $column | column name
array | $values | values
string | $connector | optional logical connector, default AND
boolean|null | $quote | optional auto-escape value, default to global

#### Returns

\PG\MSF\Pools\Miner

#

## Tags

None found

### havingNotIn()

    havingNotIn(string  $column, array  $values, string  $connector = self::LOGICAL_AND, boolean|null  $quote = null) : \PG\MSF\Pools\Miner

Add a NOT IN HAVING condition.

#### Parameters

string | $column | column name
array | $values | values
string | $connector | optional logical connector, default AND
boolean|null | $quote | optional auto-escape value, default to global

#### Returns

\PG\MSF\Pools\Miner

#

## Tags

None found

### havingBetween()

    havingBetween(string  $column, mixed  $min, mixed  $max, string  $connector = self::LOGICAL_AND, boolean|null  $quote = null) : \PG\MSF\Pools\Miner

Add a BETWEEN HAVING condition.

#### Parameters

string | $column | column name
mixed | $min | minimum value
mixed | $max | maximum value
string | $connector | optional logical connector, default AND
boolean|null | $quote | optional auto-escape value, default to global

#### Returns

\PG\MSF\Pools\Miner

#

## Tags

None found

### havingNotBetween()

    havingNotBetween(string  $column, mixed  $min, mixed  $max, string  $connector = self::LOGICAL_AND, boolean|null  $quote = null) : \PG\MSF\Pools\Miner

Add a NOT BETWEEN HAVING condition.

#### Parameters

string | $column | column name
mixed | $min | minimum value
mixed | $max | maximum value
string | $connector | optional logical connector, default AND
boolean|null | $quote | optional auto-escape value, default to global

#### Returns

\PG\MSF\Pools\Miner

#

## Tags

None found

### insertInto()

    insertInto(  $table) : \PG\MSF\Pools\Miner

ISet the INSERT INTO table.

#### Parameters

| $table |

#### Returns

\PG\MSF\Pools\Miner

#

## Tags

None found

### insert()

    insert(string  $table) : \PG\MSF\Pools\Miner

Set the INSERT table.

#### Parameters

string | $table | INSERT table

#### Returns

\PG\MSF\Pools\Miner

#

## Tags

None found

### replaceInto()

    replaceInto(  $table) : \PG\MSF\Pools\Miner

ISet the REPLACE INTO table.

#### Parameters

| $table |

#### Returns

\PG\MSF\Pools\Miner

#

## Tags

None found

### replace()

    replace(string  $table) : \PG\MSF\Pools\Miner

Set the REPLACE table.

#### Parameters

string | $table | REPLACE table

#### Returns

\PG\MSF\Pools\Miner

#

## Tags

None found

### updateInto()

    updateInto(  $table) : \PG\MSF\Pools\Miner

ISet the UPDATE INTO table.

#### Parameters

| $table |

#### Returns

\PG\MSF\Pools\Miner

#

## Tags

None found

### update()

    update(string  $table) : \PG\MSF\Pools\Miner

Set the UPDATE table.

#### Parameters

string | $table | UPDATE table

#### Returns

\PG\MSF\Pools\Miner

#

## Tags

None found

### __toString()

    __toString() : string

Get the full SQL statement without value placeholders.

#### Returns

string —

full SQL statement

#

## Tags

None found

### getStatement()

    getStatement(boolean  $usePlaceholders = true) : string

Get the full SQL statement.

#### Parameters

boolean | $usePlaceholders | optional use ? placeholders, default true

#### Returns

string —

full SQL statement

#

## Tags

None found

### isSelect()

    isSelect() : boolean

Whether this is a SELECT statement.

#### Returns

boolean —

whether this is a SELECT statement

#

## Tags

None found

### getSelectString()

    getSelectString(boolean  $includeText = true) : string

Get the SELECT portion of the statement as a string.

#### Parameters

boolean | $includeText | optional include 'SELECT' text, default true

#### Returns

string —

SELECT portion of the statement

#

## Tags

None found

### getOptionsString()

    getOptionsString(boolean  $includeTrailingSpace = false) : string

Get the execution options portion of the statement as a string.

#### Parameters

boolean | $includeTrailingSpace | optional include space after options

#### Returns

string —

execution options portion of the statement

#

## Tags

None found

### getFromString()

    getFromString(boolean  $includeText = true) : string

Get the FROM portion of the statement, including all JOINs, as a string.

#### Parameters

boolean | $includeText | optional include 'FROM' text, default true

#### Returns

string —

FROM portion of the statement

#

## Tags

None found

### getFrom()

    getFrom() : string

Get the FROM table.

#### Returns

string —

FROM table

#

## Tags

None found

### getFromAlias()

    getFromAlias() : string

Get the FROM table alias.

#### Returns

string —

FROM table alias

#

## Tags

None found

### getJoinString()

    getJoinString() : string

Get the JOIN portion of the statement as a string.

#### Returns

string —

JOIN portion of the statement

#

## Tags

None found

### isUpdate()

    isUpdate() : boolean

Whether this is an UPDATE statement.

#### Returns

boolean —

whether this is an UPDATE statement

#

## Tags

None found

### getUpdate()

    getUpdate() : string

Get the UPDATE table.

#### Returns

string —

UPDATE table

#

## Tags

None found

### getWhereString()

    getWhereString(boolean  $usePlaceholders = true, boolean  $includeText = true) : string

Get the WHERE portion of the statement as a string.

#### Parameters

boolean | $usePlaceholders | optional use ? placeholders, default true
boolean | $includeText | optional include 'WHERE' text, default true

#### Returns

string —

WHERE portion of the statement

#

## Tags

None found

### getAutoQuote()

    getAutoQuote(boolean|null  $override = null) : boolean

Get whether values will be automatically escaped.

The $override parameter is for convenience in checking if a specific value should be quoted differently than the rest. 'null' defers to the global setting.

#### Parameters

boolean|null | $override | value-specific override for convenience

#### Returns

boolean

#

## Tags

None found

### setAutoQuote()

    setAutoQuote(boolean|null  $autoQuote) : \PG\MSF\Pools\Miner

Set whether to automatically escape values.

#### Parameters

boolean|null | $autoQuote | whether to automatically escape values

#### Returns

\PG\MSF\Pools\Miner

#

## Tags

None found

### autoQuote()

    autoQuote(mixed  $value, boolean|null  $override = null) : mixed|false

Safely escape a value if auto-quoting is enabled, or do nothing if disabled.

The $override parameter is for convenience in checking if a specific value should be quoted differently than the rest. 'null' defers to the global setting.

#### Parameters

mixed | $value | value to escape (or not)
boolean|null | $override | value-specific override for convenience

#### Returns

mixed|false —

value (escaped or original) or false if failed

#

## Tags

None found

### quote()

    quote(mixed  $value) : mixed|false

Safely escape a value for use in a statement.

#### Parameters

mixed | $value | value to escape

#### Returns

mixed|false —

escaped value or false if failed

#

## Tags

None found

### getPdoConnection()

    getPdoConnection() : \PDO|null

Get the PDO database connection to use in executing this statement.

#### Returns

\PDO|null

#

## Tags

None found

### setPdoConnection()

    setPdoConnection(\PDO|null  $PdoConnection = null) : \PG\MSF\Pools\Miner

Set the PDO database connection to use in executing this statement.

#### Parameters

\PDO|null | $PdoConnection | optional PDO database connection

#### Returns

\PG\MSF\Pools\Miner

#

## Tags

None found

### getGroupByString()

    getGroupByString(boolean  $includeText = true) : string

Get the GROUP BY portion of the statement as a string.

#### Parameters

boolean | $includeText | optional include 'GROUP BY' text, default true

#### Returns

string —

GROUP BY portion of the statement

#

## Tags

None found

### getHavingString()

    getHavingString(boolean  $usePlaceholders = true, boolean  $includeText = true) : string

Get the HAVING portion of the statement as a string.

#### Parameters

boolean | $usePlaceholders | optional use ? placeholders, default true
boolean | $includeText | optional include 'HAVING' text, default true

#### Returns

string —

HAVING portion of the statement

#

## Tags

None found

### getOrderByString()

    getOrderByString(boolean  $includeText = true) : string

Get the ORDER BY portion of the statement as a string.

#### Parameters

boolean | $includeText | optional include 'ORDER BY' text, default true

#### Returns

string —

ORDER BY portion of the statement

#

## Tags

None found

### getLimitString()

    getLimitString(boolean  $includeText = true) : string

Get the LIMIT portion of the statement as a string.

#### Parameters

boolean | $includeText | optional include 'LIMIT' text, default true

#### Returns

string —

LIMIT portion of the statement

#

## Tags

None found

### isInsert()

    isInsert() : boolean

Whether this is an INSERT statement.

#### Returns

boolean —

whether this is an INSERT statement

#

## Tags

None found

### getInsertString()

    getInsertString(boolean  $includeText = true) : string

Get the INSERT portion of the statement as a string.

#### Parameters

boolean | $includeText | optional include 'INSERT' text, default true

#### Returns

string —

INSERT portion of the statement

#

## Tags

None found

### getInsert()

    getInsert() : string

Get the INSERT table.

#### Returns

string —

INSERT table

#

## Tags

None found

### getIntoString()

    getIntoString(boolean  $usePlaceholders = true) : string

Get the INTO portion of the statement as a string.

#### Parameters

boolean | $usePlaceholders |

#### Returns

string

#

## Tags

None found

### getSetString()

    getSetString(boolean  $usePlaceholders = true, boolean  $includeText = true) : string

Get the SET portion of the statement as a string.

#### Parameters

boolean | $usePlaceholders | optional use ? placeholders, default true
boolean | $includeText | optional include 'SET' text, default true

#### Returns

string —

SET portion of the statement

#

## Tags

None found

### isReplace()

    isReplace() : boolean

Whether this is a REPLACE statement.

#### Returns

boolean —

whether this is a REPLACE statement

#

## Tags

None found

### getReplaceString()

    getReplaceString(boolean  $includeText = true) : string

Get the REPLACE portion of the statement as a string.

#### Parameters

boolean | $includeText | optional include 'REPLACE' text, default true

#### Returns

string —

REPLACE portion of the statement

#

## Tags

None found

### getReplace()

    getReplace() : string

Get the REPLACE table.

#### Returns

string —

REPLACE table

#

## Tags

None found

### getUpdateString()

    getUpdateString(boolean  $includeText = true) : string

Get the UPDATE portion of the statement as a string.

#### Parameters

boolean | $includeText | optional include 'UPDATE' text, default true

#### Returns

string —

UPDATE portion of the statement

#

## Tags

None found

### isDelete()

    isDelete() : boolean

Whether this is a DELETE statement.

#### Returns

boolean —

whether this is a DELETE statement

#

## Tags

None found

### getDeleteString()

    getDeleteString(boolean  $includeText = true) : string

Get the DELETE portion of the statement as a string.

#### Parameters

boolean | $includeText | optional include 'DELETE' text, default true

#### Returns

string —

DELETE portion of the statement

#

## Tags

None found

### go()

    go(null  $bindId = null, null  $sql = null) : mixed|\PG\MSF\Coroutine\MySql

协程的方式

#### Parameters

null | $bindId |
null | $sql |

#### Returns

mixed|\PG\MSF\Coroutine\MySql

#

## Tags

None found

### mergeInto()

    mergeInto(\PG\MSF\Pools\Miner  $Miner, boolean  $overrideLimit = true) : \PG\MSF\Pools\Miner

Merge this Miner into the given Miner.

#### Parameters

\PG\MSF\Pools\Miner | $Miner | to merge into
boolean | $overrideLimit | optional override limit, default true

#### Returns

\PG\MSF\Pools\Miner

#

## Tags

None found

### mergeSelectInto()

    mergeSelectInto(\PG\MSF\Pools\Miner  $Miner) : \PG\MSF\Pools\Miner

Merge this Miner's SELECT into the given Miner.

#### Parameters

\PG\MSF\Pools\Miner | $Miner | to merge into

#### Returns

\PG\MSF\Pools\Miner

#

## Tags

None found

### mergeOptionsInto()

    mergeOptionsInto(\PG\MSF\Pools\Miner  $Miner) : \PG\MSF\Pools\Miner

Merge this Miner's execution options into the given Miner.

#### Parameters

\PG\MSF\Pools\Miner | $Miner | to merge into

#### Returns

\PG\MSF\Pools\Miner

#

## Tags

None found

### select()

    select(string  $column, string  $alias = null) : \PG\MSF\Pools\Miner

Add a SELECT column, table, or expression with optional alias.

#### Parameters

string | $column | column name, table name, or expression
string | $alias | optional alias

#### Returns

\PG\MSF\Pools\Miner

#

## Tags

None found

### mergeFromInto()

    mergeFromInto(\PG\MSF\Pools\Miner  $Miner) : \PG\MSF\Pools\Miner

Merge this Miner's FROM into the given Miner.

#### Parameters

\PG\MSF\Pools\Miner | $Miner | to merge into

#### Returns

\PG\MSF\Pools\Miner

#

## Tags

None found

### from()

    from(string  $table, string  $alias = null) : \PG\MSF\Pools\Miner

Set the FROM table with optional alias.

#### Parameters

string | $table | table name
string | $alias | optional alias

#### Returns

\PG\MSF\Pools\Miner

#

## Tags

None found

### mergeJoinInto()

    mergeJoinInto(\PG\MSF\Pools\Miner  $Miner) : \PG\MSF\Pools\Miner

Merge this Miner's JOINs into the given Miner.

#### Parameters

\PG\MSF\Pools\Miner | $Miner | to merge into

#### Returns

\PG\MSF\Pools\Miner

#

## Tags

None found

### mergeWhereInto()

    mergeWhereInto(\PG\MSF\Pools\Miner  $Miner) : \PG\MSF\Pools\Miner

Merge this Miner's WHERE into the given Miner.

#### Parameters

\PG\MSF\Pools\Miner | $Miner | to merge into

#### Returns

\PG\MSF\Pools\Miner

#

## Tags

None found

### openWhere()

    openWhere(string  $connector = self::LOGICAL_AND) : \PG\MSF\Pools\Miner

Add an open bracket for nesting WHERE conditions.

#### Parameters

string | $connector | optional logical connector, default AND

#### Returns

\PG\MSF\Pools\Miner

#

## Tags

None found

### closeWhere()

    closeWhere() : \PG\MSF\Pools\Miner

Add a closing bracket for nesting WHERE conditions.

#### Returns

\PG\MSF\Pools\Miner

#

## Tags

None found

### where()

    where(string  $column, mixed  $value, string  $operator = self::EQUALS, string  $connector = self::LOGICAL_AND, boolean|null  $quote = null) : \PG\MSF\Pools\Miner

Add a WHERE condition.

#### Parameters

string | $column | column name
mixed | $value | value
string | $operator | optional comparison operator, default =
string | $connector | optional logical connector, default AND
boolean|null | $quote | optional auto-escape value, default to global

#### Returns

\PG\MSF\Pools\Miner

#

## Tags

None found

### mergeGroupByInto()

    mergeGroupByInto(\PG\MSF\Pools\Miner  $Miner) : \PG\MSF\Pools\Miner

Merge this Miner's GROUP BY into the given Miner.

#### Parameters

\PG\MSF\Pools\Miner | $Miner | to merge into

#### Returns

\PG\MSF\Pools\Miner

#

## Tags

None found

### groupBy()

    groupBy(string  $column, string|null  $order = null) : \PG\MSF\Pools\Miner

Add a GROUP BY column.

#### Parameters

string | $column | column name
string|null | $order | optional order direction, default none

#### Returns

\PG\MSF\Pools\Miner

#

## Tags

None found

### mergeHavingInto()

    mergeHavingInto(\PG\MSF\Pools\Miner  $Miner) : \PG\MSF\Pools\Miner

Merge this Miner's HAVING into the given Miner.

#### Parameters

\PG\MSF\Pools\Miner | $Miner | to merge into

#### Returns

\PG\MSF\Pools\Miner

#

## Tags

None found

### openHaving()

    openHaving(string  $connector = self::LOGICAL_AND) : \PG\MSF\Pools\Miner

Add an open bracket for nesting HAVING conditions.

#### Parameters

string | $connector | optional logical connector, default AND

#### Returns

\PG\MSF\Pools\Miner

#

## Tags

None found

### closeHaving()

    closeHaving() : \PG\MSF\Pools\Miner

Add a closing bracket for nesting HAVING conditions.

#### Returns

\PG\MSF\Pools\Miner

#

## Tags

None found

### having()

    having(string  $column, mixed  $value, string  $operator = self::EQUALS, string  $connector = self::LOGICAL_AND, boolean|null  $quote = null) : \PG\MSF\Pools\Miner

Add a HAVING condition.

#### Parameters

string | $column | colum name
mixed | $value | value
string | $operator | optional comparison operator, default =
string | $connector | optional logical connector, default AND
boolean|null | $quote | optional auto-escape value, default to global

#### Returns

\PG\MSF\Pools\Miner

#

## Tags

None found

### mergeOrderByInto()

    mergeOrderByInto(\PG\MSF\Pools\Miner  $Miner) : \PG\MSF\Pools\Miner

Merge this Miner's ORDER BY into the given Miner.

#### Parameters

\PG\MSF\Pools\Miner | $Miner | to merge into

#### Returns

\PG\MSF\Pools\Miner

#

## Tags

None found

### orderBy()

    orderBy(string  $column, string  $order = self::ORDER_BY_ASC) : \PG\MSF\Pools\Miner

Add a column to ORDER BY.

#### Parameters

string | $column | column name
string | $order | optional order direction, default ASC

#### Returns

\PG\MSF\Pools\Miner

#

## Tags

None found

### mergeLimitInto()

    mergeLimitInto(\PG\MSF\Pools\Miner  $Miner) : \PG\MSF\Pools\Miner

Merge this Miner's LIMIT into the given Miner.

#### Parameters

\PG\MSF\Pools\Miner | $Miner | to merge into

#### Returns

\PG\MSF\Pools\Miner

#

## Tags

None found

### limit()

    limit(integer|string  $limit, integer|string  $offset) : \PG\MSF\Pools\Miner

Set the LIMIT on number of rows to return with optional offset.

#### Parameters

integer|string | $limit | number of rows to return
integer|string | $offset | optional row number to start at, default 0

#### Returns

\PG\MSF\Pools\Miner

#

## Tags

None found

### getLimit()

    getLimit() : integer|string

Get the LIMIT on number of rows to return.

#### Returns

integer|string —

LIMIT on number of rows to return

#

## Tags

None found

### getLimitOffset()

    getLimitOffset() : integer|string

Get the LIMIT row number to start at.

#### Returns

integer|string —

LIMIT row number to start at

#

## Tags

None found

### mergeInsertInto()

    mergeInsertInto(\PG\MSF\Pools\Miner  $Miner) : \PG\MSF\Pools\Miner

Merge this Miner's INSERT into the given Miner.

#### Parameters

\PG\MSF\Pools\Miner | $Miner | to merge into

#### Returns

\PG\MSF\Pools\Miner

#

## Tags

None found

### mergeSetInto()

    mergeSetInto(\PG\MSF\Pools\Miner  $Miner) : \PG\MSF\Pools\Miner

Merge this Miner's SET into the given Miner.

#### Parameters

\PG\MSF\Pools\Miner | $Miner | to merge into

#### Returns

\PG\MSF\Pools\Miner

#

## Tags

None found

### mergeReplaceInto()

    mergeReplaceInto(\PG\MSF\Pools\Miner  $Miner) : \PG\MSF\Pools\Miner

Merge this Miner's REPLACE into the given Miner.

#### Parameters

\PG\MSF\Pools\Miner | $Miner | to merge into

#### Returns

\PG\MSF\Pools\Miner

#

## Tags

None found

### mergeUpdateInto()

    mergeUpdateInto(\PG\MSF\Pools\Miner  $Miner) : \PG\MSF\Pools\Miner

Merge this Miner's UPDATE into the given Miner.

#### Parameters

\PG\MSF\Pools\Miner | $Miner | to merge into

#### Returns

\PG\MSF\Pools\Miner

#

## Tags

None found

### mergeDeleteInto()

    mergeDeleteInto(\PG\MSF\Pools\Miner  $Miner) : \PG\MSF\Pools\Miner

Merge this Miner's DELETE into the given Miner.

#### Parameters

\PG\MSF\Pools\Miner | $Miner | to merge into

#### Returns

\PG\MSF\Pools\Miner

#

## Tags

None found

### delete()

    delete(string|false  $table = false) : \PG\MSF\Pools\Miner

Add a table to DELETE from, or false if deleting from the FROM table.

#### Parameters

string|false | $table | optional table name, default false

#### Returns

\PG\MSF\Pools\Miner

#

## Tags

None found

### clear()

    clear()

清除Build Query相关变量数据

#

## Tags

None found

### pdoCommitTrans()

    pdoCommitTrans()

提交事务

#

## Tags

None found

### pdoBeginTrans()

    pdoBeginTrans()

开始事务

#

## Tags

None found

### pdoRollBackTrans()

    pdoRollBackTrans()

事务回滚

#

## Tags

None found

### pdoQuery()

    pdoQuery(string  $sql = null, array  $palceholderValues = null, integer  $fetchmode = \PDO::FETCH_ASSOC) : array|boolean|integer|null|string

pdo Query

#### Parameters

string | $sql |
array | $palceholderValues |
integer | $fetchmode |

#### Returns

array|boolean|integer|null|string

#

## Tags

None found

### pdoConnect()

    pdoConnect(  $activeConfig)

PDO连接

#### Parameters

| $activeConfig |

#

## Tags

None found

### getPlaceholderValues()

    getPlaceholderValues() : array

Get all placeholder values (SET, WHERE, and HAVING).

#### Returns

array —

all placeholder values

#

## Tags

None found

### getSetPlaceholderValues()

    getSetPlaceholderValues() : array

Get the SET placeholder values.

#### Returns

array —

SET placeholder values

#

## Tags

None found

### getWherePlaceholderValues()

    getWherePlaceholderValues() : array

Get the WHERE placeholder values.

#### Returns

array —

WHERE placeholder values

#

## Tags

None found

### getHavingPlaceholderValues()

    getHavingPlaceholderValues() : array

Get the HAVING placeholder values.

#### Returns

array —

HAVING placeholder values

#

## Tags

None found

### pdoInsertId()

    pdoInsertId() : string

返回 lastInsertId

#### Returns

string

#

## Tags

None found

### pdoExecute()

    pdoExecute(  $sql,   $palceholderValues) : \PDOStatement|false

Execute the statement using the PDO database connection.

#### Parameters

| $sql | string
| $palceholderValues | array

#### Returns

\PDOStatement|false —

executed statement or false if failed

#

## Tags

None found

### isJoinUnique()

    isJoinUnique(string  $table, string  $alias) : boolean

Whether the join table and alias is unique (hasn't already been joined).

#### Parameters

string | $table | table name
string | $alias | table alias

#### Returns

boolean —

whether the join table and alias is unique

#

## Tags

None found

### criteria()

    criteria(array  $criteria, string  $column, mixed  $value, string  $operator = self::EQUALS, string  $connector = self::LOGICAL_AND, boolean|null  $quote = null) : \PG\MSF\Pools\Miner

Add a condition to the specified WHERE or HAVING criteria.

#### Parameters

array | $criteria | WHERE or HAVING criteria
string | $column | column name
mixed | $value | value
string | $operator | optional comparison operator, default =
string | $connector | optional logical connector, default AND
boolean|null | $quote | optional auto-escape value, default to global

#### Returns

\PG\MSF\Pools\Miner

#

## Tags

None found

### orCriteria()

    orCriteria(array  $criteria, string  $column, mixed  $value, string  $operator = self::EQUALS, boolean|null  $quote = null) : \PG\MSF\Pools\Miner

Add an OR condition to the specified WHERE or HAVING criteria.

#### Parameters

array | $criteria | WHERE or HAVING criteria
string | $column | column name
mixed | $value | value
string | $operator | optional comparison operator, default =
boolean|null | $quote | optional auto-escape value, default to global

#### Returns

\PG\MSF\Pools\Miner

#

## Tags

None found

### criteriaIn()

    criteriaIn(array  $criteria, string  $column, array  $values, string  $connector = self::LOGICAL_AND, boolean|null  $quote = null) : \PG\MSF\Pools\Miner

Add an IN condition to the specified WHERE or HAVING criteria.

#### Parameters

array | $criteria | WHERE or HAVING criteria
string | $column | column name
array | $values | values
string | $connector | optional logical connector, default AND
boolean|null | $quote | optional auto-escape value, default to global

#### Returns

\PG\MSF\Pools\Miner

#

## Tags

None found

### criteriaNotIn()

    criteriaNotIn(array  $criteria, string  $column, array  $values, string  $connector = self::LOGICAL_AND, boolean|null  $quote = null) : \PG\MSF\Pools\Miner

Add a NOT IN condition to the specified WHERE or HAVING criteria.

#### Parameters

array | $criteria | WHERE or HAVING criteria
string | $column | column name
array | $values | values
string | $connector | optional logical connector, default AND
boolean|null | $quote | optional auto-escape value, default to global

#### Returns

\PG\MSF\Pools\Miner

#

## Tags

None found

### criteriaBetween()

    criteriaBetween(array  $criteria, string  $column, mixed  $min, mixed  $max, string  $connector = self::LOGICAL_AND, boolean|null  $quote = null) : \PG\MSF\Pools\Miner

Add a BETWEEN condition to the specified WHERE or HAVING criteria.

#### Parameters

array | $criteria | WHERE or HAVING criteria
string | $column | column name
mixed | $min | minimum value
mixed | $max | maximum value
string | $connector | optional logical connector, default AND
boolean|null | $quote | optional auto-escape value, default to global

#### Returns

\PG\MSF\Pools\Miner

#

## Tags

None found

### criteriaNotBetween()

    criteriaNotBetween(array  $criteria, string  $column, mixed  $min, mixed  $max, string  $connector = self::LOGICAL_AND, boolean|null  $quote = null) : \PG\MSF\Pools\Miner

Add a NOT BETWEEN condition to the specified WHERE or HAVING criteria.

#### Parameters

array | $criteria | WHERE or HAVING criteria
string | $column | column name
mixed | $min | minimum value
mixed | $max | maximum value
string | $connector | optional logical connector, default AND
boolean|null | $quote | optional auto-escape value, default to global

#### Returns

\PG\MSF\Pools\Miner

#

## Tags

None found

### getSelectStatement()

    getSelectStatement(boolean  $usePlaceholders = true) : string

Get the full SELECT statement.

#### Parameters

boolean | $usePlaceholders | optional use ? placeholders, default true

#### Returns

string —

full SELECT statement

#

## Tags

None found

### getJoinCriteriaUsingPreviousTable()

    getJoinCriteriaUsingPreviousTable(integer  $joinIndex, string  $table, string  $column) : string

Get an ON criteria string joining the specified table and column to the same column of the previous JOIN or FROM table.

#### Parameters

integer | $joinIndex | index of current join
string | $table | current table name
string | $column | current column name

#### Returns

string —

ON join criteria

#

## Tags

None found

### getCriteriaString()

    getCriteriaString(array  $criteria, boolean  $usePlaceholders = true, array  $placeholderValues = array()) : string

Get the WHERE or HAVING portion of the statement as a string.

#### Parameters

array | $criteria | WHERE or HAVING criteria
boolean | $usePlaceholders | optional use ? placeholders, default true
array | $placeholderValues | optional placeholder values array

#### Returns

string —

WHERE or HAVING portion of the statement

#

## Tags

None found

### getInsertStatement()

    getInsertStatement(boolean  $usePlaceholders = true) : string

Get the full INSERT statement.

#### Parameters

boolean | $usePlaceholders | optional use ? placeholders, default true

#### Returns

string —

full INSERT statement

#

## Tags

None found

### getReplaceStatement()

    getReplaceStatement(boolean  $usePlaceholders = true) : string

Get the full REPLACE statement.

#### Parameters

boolean | $usePlaceholders | optional use ? placeholders, default true

#### Returns

string —

full REPLACE statement

#

## Tags

None found

### getUpdateStatement()

    getUpdateStatement(boolean  $usePlaceholders = true) : string

Get the full UPDATE statement.

#### Parameters

boolean | $usePlaceholders | optional use ? placeholders, default true

#### Returns

string —

full UPDATE statement

#

## Tags

None found

### getDeleteStatement()

    getDeleteStatement(boolean  $usePlaceholders = true) : string

Get the full DELETE statement.

#### Parameters

boolean | $usePlaceholders | optional use ? placeholders, default true

#### Returns

string —

full DELETE statement

#

## Tags

None found

### isDeleteTableFrom()

    isDeleteTableFrom() : boolean

Whether the FROM table is the single table to delete from.

#### Returns

boolean —

whether the delete table is FROM

#

## Tags

None found

### openCriteria()

    openCriteria(array  $criteria, string  $connector = self::LOGICAL_AND) : \PG\MSF\Pools\Miner

Add an open bracket for nesting conditions to the specified WHERE or HAVING criteria.

#### Parameters

array | $criteria | WHERE or HAVING criteria
string | $connector | optional logical connector, default AND

#### Returns

\PG\MSF\Pools\Miner

#

## Tags

None found

### closeCriteria()

    closeCriteria(array  $criteria) : \PG\MSF\Pools\Miner

Add a closing bracket for nesting conditions to the specified WHERE or HAVING criteria.

#### Parameters

array | $criteria | WHERE or HAVING criteria

#### Returns

\PG\MSF\Pools\Miner

#

## Tags

None found

### Miner.php