tableNames( 'user', 'watchlist' ) ); * $sql = "SELECT wl_namespace,wl_title FROM $watchlist,$user * WHERE wl_user=user_id AND wl_user=$nameWithQuotes"; * * @return array */ public function tableNames(); /** * Fetch a number of table names into an zero-indexed numerical array * This is handy when you need to construct SQL for joins * * Example: * list( $user, $watchlist ) = $dbr->tableNamesN( 'user', 'watchlist' ); * $sql = "SELECT wl_namespace,wl_title FROM $watchlist,$user * WHERE wl_user=user_id AND wl_user=$nameWithQuotes"; * * @return array */ public function tableNamesN(); /** * Returns the size of a text field, or -1 for "unlimited" * * @param string $table * @param string $field * @return int */ public function textFieldSize( $table, $field ); /** * Read and execute SQL commands from a file. * * Returns true on success, error string or exception on failure (depending * on object's error ignore settings). * * @param string $filename File name to open * @param callable|null $lineCallback Optional function called before reading each line * @param callable|null $resultCallback Optional function called for each MySQL result * @param bool|string $fname Calling function name or false if name should be * generated dynamically using $filename * @param callable|null $inputCallback Optional function called for each * complete line sent * @return bool|string * @throws Exception */ public function sourceFile( $filename, callable $lineCallback = null, callable $resultCallback = null, $fname = false, callable $inputCallback = null ); /** * Read and execute commands from an open file handle. * * Returns true on success, error string or exception on failure (depending * on object's error ignore settings). * * @param resource $fp File handle * @param callable|null $lineCallback Optional function called before reading each query * @param callable|null $resultCallback Optional function called for each MySQL result * @param string $fname Calling function name * @param callable|null $inputCallback Optional function called for each complete query sent * @return bool|string */ public function sourceStream( $fp, callable $lineCallback = null, callable $resultCallback = null, $fname = __METHOD__, callable $inputCallback = null ); /** * Called by sourceStream() to check if we've reached a statement end * * @param string &$sql SQL assembled so far * @param string &$newLine New line about to be added to $sql * @return bool Whether $newLine contains end of the statement */ public function streamStatementEnd( &$sql, &$newLine ); /** * Delete a table * @param string $tableName * @param string $fName * @return bool|ResultWrapper */ public function dropTable( $tableName, $fName = __METHOD__ ); /** * Perform a deadlock-prone transaction. * * This function invokes a callback function to perform a set of write * queries. If a deadlock occurs during the processing, the transaction * will be rolled back and the callback function will be called again. * * Avoid using this method outside of Job or Maintenance classes. * * Usage: * $dbw->deadlockLoop( callback, ... ); * * Extra arguments are passed through to the specified callback function. * This method requires that no transactions are already active to avoid * causing premature commits or exceptions. * * Returns whatever the callback function returned on its successful, * iteration, or false on error, for example if the retry limit was * reached. * * @return mixed * @throws DBUnexpectedError * @throws Exception */ public function deadlockLoop(); /** * Lists all the VIEWs in the database * * @param string $prefix Only show VIEWs with this prefix, eg. unit_test_ * @param string $fname Name of calling function * @throws RuntimeException * @return array */ public function listViews( $prefix = null, $fname = __METHOD__ ); }