MediaWiki REL1_35
IMaintainableDatabase.php
Go to the documentation of this file.
1<?php
2
24namespace Wikimedia\Rdbms;
25
26use Exception;
27use RuntimeException;
28
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
239
280 public function lockTables( array $read, array $write, $method );
281
292 public function unlockTables( $method );
293
302 public function listTables( $prefix = null, $fname = __METHOD__ );
303
313 public function indexUnique( $table, $index, $fname = __METHOD__ );
314
324 public function fieldInfo( $table, $field );
325}
326
327class_alias( IMaintainableDatabase::class, 'IMaintainableDatabase' );
Basic database interface for live and lazy-loaded relation database handles.
Definition IDatabase.php:38
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)
mysql_fetch_field() wrapper 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.
unlockTables( $method)
Unlock all tables locked via lockTables()
lockTables(array $read, array $write, $method)
Lock specific tables.
sourceFile( $filename, callable $lineCallback=null, callable $resultCallback=null, $fname=false, callable $inputCallback=null)
Read and execute SQL commands from a file.
tableLocksHaveTransactionScope()
Checks if table locks acquired by lockTables() are transaction-bound in their scope.
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