MediaWiki master
IMaintainableDatabase.php
Go to the documentation of this file.
1<?php
20namespace Wikimedia\Rdbms;
21
22use Exception;
23use RuntimeException;
24
43 public function textFieldSize( $table, $field );
44
61 public function sourceFile(
62 $filename,
63 callable $lineCallback = null,
64 callable $resultCallback = null,
65 $fname = false,
66 callable $inputCallback = null
67 );
68
82 public function sourceStream(
83 $fp,
84 callable $lineCallback = null,
85 callable $resultCallback = null,
86 $fname = __METHOD__,
87 callable $inputCallback = null
88 );
89
97 public function streamStatementEnd( &$sql, &$newLine );
98
107 public function dropTable( $table, $fname = __METHOD__ );
108
117 public function truncateTable( $table, $fname = __METHOD__ );
118
128 public function truncate( $tables, $fname = __METHOD__ );
129
141 public function listViews( $prefix = null, $fname = __METHOD__ );
142
158 public function duplicateTableStructure(
159 $oldName, $newName, $temporary = false, $fname = __METHOD__
160 );
161
172 public function listTables( $prefix = null, $fname = __METHOD__ );
173
183 public function indexUnique( $table, $index, $fname = __METHOD__ );
184
194 public function fieldInfo( $table, $field );
195
205 public function fieldExists( $table, $field, $fname = __METHOD__ );
206
216 public function indexExists( $table, $index, $fname = __METHOD__ );
217
226 public function tableExists( $table, $fname = __METHOD__ );
227}
Basic database interface for live and lazy-loaded relation database handles.
Definition IDatabase.php:36
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.
truncateTable( $table, $fname=__METHOD__)
Delete all data in a table and reset any sequences owned by that table.
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.
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.