MediaWiki  master
Wikimedia\Rdbms\GeneralizedSql Class Reference

Lazy-loaded wrapper for simplification and scrubbing of SQL queries for profiling. More...

Public Member Functions

 __construct ( $rawSql, $prefix)
 
 getRawSql ()
 
 stringify ()
 

Static Private Member Functions

static generalizeSQL ( $sql)
 Removes most variables from an SQL query and replaces them with X or N for numbers. More...
 

Private Attributes

string null $genericSql
 
string $prefix
 
string $rawSql
 

Detailed Description

Lazy-loaded wrapper for simplification and scrubbing of SQL queries for profiling.

Since
1.34

Definition at line 30 of file GeneralizedSql.php.

Constructor & Destructor Documentation

◆ __construct()

Wikimedia\Rdbms\GeneralizedSql::__construct (   $rawSql,
  $prefix 
)
Parameters
string$rawSql
string$prefix

Definition at line 43 of file GeneralizedSql.php.

References Wikimedia\Rdbms\GeneralizedSql\$prefix, and Wikimedia\Rdbms\GeneralizedSql\$rawSql.

Member Function Documentation

◆ generalizeSQL()

static Wikimedia\Rdbms\GeneralizedSql::generalizeSQL (   $sql)
staticprivate

Removes most variables from an SQL query and replaces them with X or N for numbers.

It's only slightly flawed. Don't use for anything important.

Parameters
string$sqlA SQL Query
Returns
string

Definition at line 56 of file GeneralizedSql.php.

◆ getRawSql()

Wikimedia\Rdbms\GeneralizedSql::getRawSql ( )

◆ stringify()

Wikimedia\Rdbms\GeneralizedSql::stringify ( )

Member Data Documentation

◆ $genericSql

string null Wikimedia\Rdbms\GeneralizedSql::$genericSql
private

Definition at line 37 of file GeneralizedSql.php.

Referenced by Wikimedia\Rdbms\GeneralizedSql\stringify().

◆ $prefix

string Wikimedia\Rdbms\GeneralizedSql::$prefix
private

Definition at line 34 of file GeneralizedSql.php.

Referenced by Wikimedia\Rdbms\GeneralizedSql\__construct().

◆ $rawSql

string Wikimedia\Rdbms\GeneralizedSql::$rawSql
private

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