MediaWiki  master
IMaintainableDatabase.php
Go to the documentation of this file.
1 <?php
20 namespace Wikimedia\Rdbms;
21 
22 use Exception;
23 use RuntimeException;
24 
34 interface IMaintainableDatabase extends IDatabase {
42  public function textFieldSize( $table, $field );
43 
60  public function sourceFile(
61  $filename,
62  callable $lineCallback = null,
63  callable $resultCallback = null,
64  $fname = false,
65  callable $inputCallback = null
66  );
67 
81  public function sourceStream(
82  $fp,
83  callable $lineCallback = null,
84  callable $resultCallback = null,
85  $fname = __METHOD__,
86  callable $inputCallback = null
87  );
88 
96  public function streamStatementEnd( &$sql, &$newLine );
97 
106  public function dropTable( $table, $fname = __METHOD__ );
107 
116  public function truncate( $tables, $fname = __METHOD__ );
117 
143  public function deadlockLoop( ...$args );
144 
153  public function listViews( $prefix = null, $fname = __METHOD__ );
154 
170  public function duplicateTableStructure(
171  $oldName, $newName, $temporary = false, $fname = __METHOD__
172  );
173 
182  public function listTables( $prefix = null, $fname = __METHOD__ );
183 
193  public function indexUnique( $table, $index, $fname = __METHOD__ );
194 
204  public function fieldInfo( $table, $field );
205 
215  public function fieldExists( $table, $field, $fname = __METHOD__ );
216 
226  public function indexExists( $table, $index, $fname = __METHOD__ );
227 
236  public function tableExists( $table, $fname = __METHOD__ );
237 }
238 
239 class_alias( IMaintainableDatabase::class, 'IMaintainableDatabase' );
Basic database interface for live and lazy-loaded relation database handles.
Definition: IDatabase.php:40
Advanced database interface for IDatabase handles that include maintenance methods.
indexUnique( $table, $index, $fname=__METHOD__)
Determines if a given index is unique.
truncate( $tables, $fname=__METHOD__)
Delete all data in a table(s) and reset any sequences owned by that table(s)
fieldInfo( $table, $field)
Get information about a field Returns false if the field doesn't exist.
streamStatementEnd(&$sql, &$newLine)
Called by sourceStream() to check if we've reached a statement end.
listViews( $prefix=null, $fname=__METHOD__)
Lists all the VIEWs in the database.
listTables( $prefix=null, $fname=__METHOD__)
List all tables on the database.
textFieldSize( $table, $field)
Returns the size of a text field, or -1 for "unlimited".
dropTable( $table, $fname=__METHOD__)
Delete a table.
fieldExists( $table, $field, $fname=__METHOD__)
Determines whether a field exists in a table.
deadlockLoop(... $args)
Perform a deadlock-prone transaction.
indexExists( $table, $index, $fname=__METHOD__)
Determines whether an index exists.
sourceFile( $filename, callable $lineCallback=null, callable $resultCallback=null, $fname=false, callable $inputCallback=null)
Read and execute SQL commands from a file.
sourceStream( $fp, callable $lineCallback=null, callable $resultCallback=null, $fname=__METHOD__, callable $inputCallback=null)
Read and execute commands from an open file handle.
duplicateTableStructure( $oldName, $newName, $temporary=false, $fname=__METHOD__)
Creates a new table with structure copied from existing table.
tableExists( $table, $fname=__METHOD__)
Query whether a given table exists.
if( $line===false) $args
Definition: mcc.php:124