MediaWiki master
MwSql Class Reference

Maintenance script that sends SQL queries from the specified file to the database. More...

Inherits Maintenance.

Collaboration diagram for MwSql:

Public Member Functions

 __construct ()
 
 execute ()
 
 getDbType ()
 
 sqlPrintResult ( $res, $db)
 Print the results, callback for $db->sourceStream()
 

Protected Member Functions

 sqlDoQuery (IDatabase $db, $line, $dieOnError)
 

Detailed Description

Maintenance script that sends SQL queries from the specified file to the database.

Definition at line 40 of file sql.php.

Constructor & Destructor Documentation

◆ __construct()

MwSql::__construct ( )

Definition at line 41 of file sql.php.

Member Function Documentation

◆ execute()

MwSql::execute ( )

Definition at line 58 of file sql.php.

References $IP, DB_PRIMARY, DB_REPLICA, and sqlDoQuery().

◆ getDbType()

MwSql::getDbType ( )
Returns
int DB_TYPE constant

Definition at line 236 of file sql.php.

◆ sqlDoQuery()

MwSql::sqlDoQuery ( IDatabase $db,
$line,
$dieOnError )
protected
Parameters
IDatabase$db
string$lineThe SQL text of the query
bool$dieOnError
Returns
int|null Number of rows selected or updated, or null if the query was unsuccessful.

Definition at line 184 of file sql.php.

References Wikimedia\Rdbms\IDatabase\query(), and sqlPrintResult().

Referenced by execute().

◆ sqlPrintResult()

MwSql::sqlPrintResult ( $res,
$db )

Print the results, callback for $db->sourceStream()

Parameters
IResultWrapper | bool$res
IDatabase$db
Returns
int|null Number of rows selected or updated, or null if the query was unsuccessful.

Definition at line 204 of file sql.php.

Referenced by sqlDoQuery().


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