INNER_JOIN
INNER_JOIN
INNER JOIN type.
Class Miner
$mysqlPool : \PG\MSF\Pools\MysqlAsynPool
calcFoundRows() : \PG\MSF\Pools\Miner
Add SQL_CALC_FOUND_ROWS execution option.
option(string $option) : \PG\MSF\Pools\Miner
Add an execution option like DISTINCT or SQL_CALC_FOUND_ROWS.
string | $option | execution option to add |
distinct() : \PG\MSF\Pools\Miner
Add DISTINCT execution option.
values(array $values) : \PG\MSF\Pools\Miner
Add an array of columns => values to INSERT, UPDATE, or REPLACE.
array | $values | columns => values |
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.
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 |
innerJoin(string $table, string|array $criteria = null, string $alias = null) : \PG\MSF\Pools\Miner
Add an INNER JOIN table with optional ON criteria.
string | $table | table name |
string|array | $criteria | optional ON criteria |
string | $alias | optional alias |
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.
string | $table | table name |
string|array | $criteria | optional ON criteria |
string | $type | optional type of join, default INNER JOIN |
string | $alias | optional alias |
leftJoin(string $table, string|array $criteria = null, string $alias = null) : \PG\MSF\Pools\Miner
Add a LEFT JOIN table with optional ON criteria.
string | $table | table name |
string|array | $criteria | optional ON criteria |
string | $alias | optional alias |
rightJoin(string $table, string|array $criteria = null, string $alias = null) : \PG\MSF\Pools\Miner
Add a RIGHT JOIN table with optional ON criteria.
string | $table | table name |
string|array | $criteria | optional ON criteria |
string | $alias | optional alias |
andWhere(string $column, mixed $value, string $operator = self::EQUALS, boolean|null $quote = null) : \PG\MSF\Pools\Miner
Add an AND WHERE condition.
string | $column | colum name |
mixed | $value | value |
string | $operator | optional comparison operator, default = |
boolean|null | $quote | optional auto-escape value, default to global |
orWhere(string $column, mixed $value, string $operator = self::EQUALS, boolean|null $quote = null) : \PG\MSF\Pools\Miner
Add an OR WHERE condition.
string | $column | colum name |
mixed | $value | value |
string | $operator | optional comparison operator, default = |
boolean|null | $quote | optional auto-escape value, default to global |
whereIn(string $column, array $values, string $connector = self::LOGICAL_AND, boolean|null $quote = null) : \PG\MSF\Pools\Miner
Add an IN WHERE condition.
string | $column | column name |
array | $values | values |
string | $connector | optional logical connector, default AND |
boolean|null | $quote | optional auto-escape value, default to global |
whereNotIn(string $column, array $values, string $connector = self::LOGICAL_AND, boolean|null $quote = null) : \PG\MSF\Pools\Miner
Add a NOT IN WHERE condition.
string | $column | column name |
array | $values | values |
string | $connector | optional logical connector, default AND |
boolean|null | $quote | optional auto-escape value, default to global |
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.
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 |
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.
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 |
andHaving(string $column, mixed $value, string $operator = self::EQUALS, boolean|null $quote = null) : \PG\MSF\Pools\Miner
Add an AND HAVING condition.
string | $column | colum name |
mixed | $value | value |
string | $operator | optional comparison operator, default = |
boolean|null | $quote | optional auto-escape value, default to global |
orHaving(string $column, mixed $value, string $operator = self::EQUALS, boolean|null $quote = null) : \PG\MSF\Pools\Miner
Add an OR HAVING condition.
string | $column | colum name |
mixed | $value | value |
string | $operator | optional comparison operator, default = |
boolean|null | $quote | optional auto-escape value, default to global |
havingIn(string $column, array $values, string $connector = self::LOGICAL_AND, boolean|null $quote = null) : \PG\MSF\Pools\Miner
Add an IN WHERE condition.
string | $column | column name |
array | $values | values |
string | $connector | optional logical connector, default AND |
boolean|null | $quote | optional auto-escape value, default to global |
havingNotIn(string $column, array $values, string $connector = self::LOGICAL_AND, boolean|null $quote = null) : \PG\MSF\Pools\Miner
Add a NOT IN HAVING condition.
string | $column | column name |
array | $values | values |
string | $connector | optional logical connector, default AND |
boolean|null | $quote | optional auto-escape value, default to global |
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.
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 |
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.
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 |
insertInto( $table) : \PG\MSF\Pools\Miner
ISet the INSERT INTO table.
$table |
insert(string $table) : \PG\MSF\Pools\Miner
Set the INSERT table.
string | $table | INSERT table |
replaceInto( $table) : \PG\MSF\Pools\Miner
ISet the REPLACE INTO table.
$table |
replace(string $table) : \PG\MSF\Pools\Miner
Set the REPLACE table.
string | $table | REPLACE table |
updateInto( $table) : \PG\MSF\Pools\Miner
ISet the UPDATE INTO table.
$table |
update(string $table) : \PG\MSF\Pools\Miner
Set the UPDATE table.
string | $table | UPDATE table |
getWhereString(boolean $usePlaceholders = true, boolean $includeText = true) : string
Get the WHERE portion of the statement as a string.
boolean | $usePlaceholders | optional use ? placeholders, default true |
boolean | $includeText | optional include 'WHERE' text, default true |
WHERE portion of the statement
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.
boolean|null | $override | value-specific override for convenience |
setAutoQuote(boolean|null $autoQuote) : \PG\MSF\Pools\Miner
Set whether to automatically escape values.
boolean|null | $autoQuote | whether to automatically escape values |
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.
mixed | $value | value to escape (or not) |
boolean|null | $override | value-specific override for convenience |
value (escaped or original) or false if failed
setPdoConnection(\PDO|null $PdoConnection = null) : \PG\MSF\Pools\Miner
Set the PDO database connection to use in executing this statement.
\PDO|null | $PdoConnection | optional PDO database connection |
getHavingString(boolean $usePlaceholders = true, boolean $includeText = true) : string
Get the HAVING portion of the statement as a string.
boolean | $usePlaceholders | optional use ? placeholders, default true |
boolean | $includeText | optional include 'HAVING' text, default true |
HAVING portion of the statement
getSetString(boolean $usePlaceholders = true, boolean $includeText = true) : string
Get the SET portion of the statement as a string.
boolean | $usePlaceholders | optional use ? placeholders, default true |
boolean | $includeText | optional include 'SET' text, default true |
SET portion of the statement
go(null $bindId = null, null $sql = null) : mixed|\PG\MSF\Coroutine\MySql
协程的方式
null | $bindId | |
null | $sql |
mergeInto(\PG\MSF\Pools\Miner $Miner, boolean $overrideLimit = true) : \PG\MSF\Pools\Miner
Merge this Miner into the given Miner.
\PG\MSF\Pools\Miner | $Miner | to merge into |
boolean | $overrideLimit | optional override limit, default true |
mergeSelectInto(\PG\MSF\Pools\Miner $Miner) : \PG\MSF\Pools\Miner
Merge this Miner's SELECT into the given Miner.
\PG\MSF\Pools\Miner | $Miner | to merge into |
mergeOptionsInto(\PG\MSF\Pools\Miner $Miner) : \PG\MSF\Pools\Miner
Merge this Miner's execution options into the given Miner.
\PG\MSF\Pools\Miner | $Miner | to merge into |
select(string $column, string $alias = null) : \PG\MSF\Pools\Miner
Add a SELECT column, table, or expression with optional alias.
string | $column | column name, table name, or expression |
string | $alias | optional alias |
mergeFromInto(\PG\MSF\Pools\Miner $Miner) : \PG\MSF\Pools\Miner
Merge this Miner's FROM into the given Miner.
\PG\MSF\Pools\Miner | $Miner | to merge into |
from(string $table, string $alias = null) : \PG\MSF\Pools\Miner
Set the FROM table with optional alias.
string | $table | table name |
string | $alias | optional alias |
mergeJoinInto(\PG\MSF\Pools\Miner $Miner) : \PG\MSF\Pools\Miner
Merge this Miner's JOINs into the given Miner.
\PG\MSF\Pools\Miner | $Miner | to merge into |
mergeWhereInto(\PG\MSF\Pools\Miner $Miner) : \PG\MSF\Pools\Miner
Merge this Miner's WHERE into the given Miner.
\PG\MSF\Pools\Miner | $Miner | to merge into |
openWhere(string $connector = self::LOGICAL_AND) : \PG\MSF\Pools\Miner
Add an open bracket for nesting WHERE conditions.
string | $connector | optional logical connector, default AND |
closeWhere() : \PG\MSF\Pools\Miner
Add a closing bracket for nesting WHERE conditions.
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.
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 |
mergeGroupByInto(\PG\MSF\Pools\Miner $Miner) : \PG\MSF\Pools\Miner
Merge this Miner's GROUP BY into the given Miner.
\PG\MSF\Pools\Miner | $Miner | to merge into |
groupBy(string $column, string|null $order = null) : \PG\MSF\Pools\Miner
Add a GROUP BY column.
string | $column | column name |
string|null | $order | optional order direction, default none |
mergeHavingInto(\PG\MSF\Pools\Miner $Miner) : \PG\MSF\Pools\Miner
Merge this Miner's HAVING into the given Miner.
\PG\MSF\Pools\Miner | $Miner | to merge into |
openHaving(string $connector = self::LOGICAL_AND) : \PG\MSF\Pools\Miner
Add an open bracket for nesting HAVING conditions.
string | $connector | optional logical connector, default AND |
closeHaving() : \PG\MSF\Pools\Miner
Add a closing bracket for nesting HAVING conditions.
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.
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 |
mergeOrderByInto(\PG\MSF\Pools\Miner $Miner) : \PG\MSF\Pools\Miner
Merge this Miner's ORDER BY into the given Miner.
\PG\MSF\Pools\Miner | $Miner | to merge into |
orderBy(string $column, string $order = self::ORDER_BY_ASC) : \PG\MSF\Pools\Miner
Add a column to ORDER BY.
string | $column | column name |
string | $order | optional order direction, default ASC |
mergeLimitInto(\PG\MSF\Pools\Miner $Miner) : \PG\MSF\Pools\Miner
Merge this Miner's LIMIT into the given Miner.
\PG\MSF\Pools\Miner | $Miner | to merge into |
limit(integer|string $limit, integer|string $offset) : \PG\MSF\Pools\Miner
Set the LIMIT on number of rows to return with optional offset.
integer|string | $limit | number of rows to return |
integer|string | $offset | optional row number to start at, default 0 |
mergeInsertInto(\PG\MSF\Pools\Miner $Miner) : \PG\MSF\Pools\Miner
Merge this Miner's INSERT into the given Miner.
\PG\MSF\Pools\Miner | $Miner | to merge into |
mergeSetInto(\PG\MSF\Pools\Miner $Miner) : \PG\MSF\Pools\Miner
Merge this Miner's SET into the given Miner.
\PG\MSF\Pools\Miner | $Miner | to merge into |
mergeReplaceInto(\PG\MSF\Pools\Miner $Miner) : \PG\MSF\Pools\Miner
Merge this Miner's REPLACE into the given Miner.
\PG\MSF\Pools\Miner | $Miner | to merge into |
mergeUpdateInto(\PG\MSF\Pools\Miner $Miner) : \PG\MSF\Pools\Miner
Merge this Miner's UPDATE into the given Miner.
\PG\MSF\Pools\Miner | $Miner | to merge into |
mergeDeleteInto(\PG\MSF\Pools\Miner $Miner) : \PG\MSF\Pools\Miner
Merge this Miner's DELETE into the given Miner.
\PG\MSF\Pools\Miner | $Miner | to merge into |
delete(string|false $table = false) : \PG\MSF\Pools\Miner
Add a table to DELETE from, or false if deleting from the FROM table.
string|false | $table | optional table name, default false |
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.
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 |
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.
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 |
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.
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 |
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.
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 |
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.
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 |
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.
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 |
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.
integer | $joinIndex | index of current join |
string | $table | current table name |
string | $column | current column name |
ON join criteria
getCriteriaString(array $criteria, boolean $usePlaceholders = true, array $placeholderValues = array()) : string
Get the WHERE or HAVING portion of the statement as a string.
array | $criteria | WHERE or HAVING criteria |
boolean | $usePlaceholders | optional use ? placeholders, default true |
array | $placeholderValues | optional placeholder values array |
WHERE or HAVING portion of the statement
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.
array | $criteria | WHERE or HAVING criteria |
string | $connector | optional logical connector, default AND |
closeCriteria(array $criteria) : \PG\MSF\Pools\Miner
Add a closing bracket for nesting conditions to the specified WHERE or HAVING criteria.
array | $criteria | WHERE or HAVING criteria |