MediaWiki  master
IMaintainableDatabase.php
Go to the documentation of this file.
1 <?php
2 
24 namespace Wikimedia\Rdbms;
25 
26 use Exception;
27 use RuntimeException;
28 
38 interface IMaintainableDatabase extends IDatabase {
58  public function tableName( $name, $format = 'quoted' );
59 
72  public function tableNames( ...$tables );
73 
86  public function tableNamesN( ...$tables );
87 
95  public function textFieldSize( $table, $field );
96 
113  public function sourceFile(
114  $filename,
115  callable $lineCallback = null,
116  callable $resultCallback = null,
117  $fname = false,
118  callable $inputCallback = null
119  );
120 
134  public function sourceStream(
135  $fp,
136  callable $lineCallback = null,
137  callable $resultCallback = null,
138  $fname = __METHOD__,
139  callable $inputCallback = null
140  );
141 
149  public function streamStatementEnd( &$sql, &$newLine );
150 
159  public function dropTable( $table, $fname = __METHOD__ );
160 
169  public function truncate( $tables, $fname = __METHOD__ );
170 
196  public function deadlockLoop( ...$args );
197 
206  public function listViews( $prefix = null, $fname = __METHOD__ );
207 
223  public function duplicateTableStructure(
224  $oldName, $newName, $temporary = false, $fname = __METHOD__
225  );
226 
235  public function listTables( $prefix = null, $fname = __METHOD__ );
236 
246  public function indexUnique( $table, $index, $fname = __METHOD__ );
247 
257  public function fieldInfo( $table, $field );
258 }
259 
260 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.
tableName( $name, $format='quoted')
Format a table name ready for use in constructing an SQL query.
tableNamesN(... $tables)
Fetch a number of table names into an zero-indexed numerical array This is handy when you need to con...
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".
tableNames(... $tables)
Fetch a number of table names into an array This is handy when you need to construct SQL for joins.
dropTable( $table, $fname=__METHOD__)
Delete a table.
deadlockLoop(... $args)
Perform a deadlock-prone transaction.
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.
if( $line===false) $args
Definition: mcc.php:124