MediaWiki 1.42.0-rc.0
Wikimedia\Rdbms\Query Class Reference

Holds information on Query to be executed. More...

Public Member Functions

 __construct (string $sql, $flags, $queryVerb, string $writeTable=null, $cleanedSql='')
 
 getCleanedSql ()
 Get the cleaned/sanitized SQL statement text for logging.
 
 getFlags ()
 
 getSQL ()
 
 getVerb ()
 
 getWriteTable ()
 Get the table which is being written to, or null for a read query or if the destination is unknown.
 
 isWriteQuery ()
 

Detailed Description

Holds information on Query to be executed.

Access: internal
Since
1.41

Definition at line 31 of file Query.php.

Constructor & Destructor Documentation

◆ __construct()

Wikimedia\Rdbms\Query::__construct ( string $sql,
$flags,
$queryVerb,
string $writeTable = null,
$cleanedSql = '' )
Parameters
string$sqlSQL statement text
int$flagsBit field of ISQLPlatform::QUERY_CHANGE_* constants
string$queryVerbThe first words of the SQL statement that convey what kind of database/table/column/index command was specified. Except for the following cases, this will be the first word of the SQL statement:
  • "RELEASE SAVEPOINT"
  • "ROLLBACK TO SAVEPOINT"
  • "CREATE TEMPORARY"
  • "CREATE INDEX"
  • "DROP INDEX"
  • "CREATE DATABASE"
  • "ALTER DATABASE"
  • "DROP DATABASE"
string | null$writeTableThe table targeted for writes, if any. Can be omitted if it would be hard to identify the table (e.g. when parsing an arbitrary SQL string).
string$cleanedSqlSanitized/simplified SQL statement text for logging. Typically, this means replacing variables / parameter values with placeholders. Can be omitted, in which case the code using the Query is responsible for sanitizing.

Definition at line 59 of file Query.php.

Member Function Documentation

◆ getCleanedSql()

Wikimedia\Rdbms\Query::getCleanedSql ( )

Get the cleaned/sanitized SQL statement text for logging.

Might return an empty string, which means sanitization is the caller's responsibility.

Definition at line 123 of file Query.php.

◆ getFlags()

Wikimedia\Rdbms\Query::getFlags ( )

Definition at line 106 of file Query.php.

Referenced by Wikimedia\Rdbms\Database\registerTempTables().

◆ getSQL()

◆ getVerb()

◆ getWriteTable()

Wikimedia\Rdbms\Query::getWriteTable ( )

Get the table which is being written to, or null for a read query or if the destination is unknown.

Definition at line 115 of file Query.php.

Referenced by Wikimedia\Rdbms\Database\doSingleStatementQuery(), and Wikimedia\Rdbms\Database\registerTempTables().

◆ isWriteQuery()

Wikimedia\Rdbms\Query::isWriteQuery ( )

Definition at line 73 of file Query.php.


The documentation for this class was generated from the following file: