MediaWiki master
IMaintainableDatabase.php
Go to the documentation of this file.
1<?php
20namespace Wikimedia\Rdbms;
21
22use Exception;
23use RuntimeException;
24
51 public function sourceFile(
52 $filename,
53 ?callable $lineCallback = null,
54 ?callable $resultCallback = null,
55 $fname = false,
56 ?callable $inputCallback = null
57 );
58
72 public function sourceStream(
73 $fp,
74 ?callable $lineCallback = null,
75 ?callable $resultCallback = null,
76 $fname = __METHOD__,
77 ?callable $inputCallback = null
78 );
79
87 public function streamStatementEnd( &$sql, &$newLine );
88
97 public function dropTable( $table, $fname = __METHOD__ );
98
107 public function truncateTable( $table, $fname = __METHOD__ );
108
124 public function duplicateTableStructure(
125 $oldName, $newName, $temporary = false, $fname = __METHOD__
126 );
127
138 public function listTables( $prefix = null, $fname = __METHOD__ );
139
149 public function fieldInfo( $table, $field );
150
160 public function fieldExists( $table, $field, $fname = __METHOD__ );
161
171 public function indexExists( $table, $index, $fname = __METHOD__ );
172
182 public function indexUnique( $table, $index, $fname = __METHOD__ );
183
192 public function tableExists( $table, $fname = __METHOD__ );
193}
Interface to a relational database.
Definition IDatabase.php:48
Advanced database interface for IDatabase handles that include maintenance methods.
indexUnique( $table, $index, $fname=__METHOD__)
Determines if a given index is unique.
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.
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.
sourceStream( $fp, ?callable $lineCallback=null, ?callable $resultCallback=null, $fname=__METHOD__, ?callable $inputCallback=null)
Read and execute commands from an open file handle.
dropTable( $table, $fname=__METHOD__)
Delete a table.
sourceFile( $filename, ?callable $lineCallback=null, ?callable $resultCallback=null, $fname=false, ?callable $inputCallback=null)
Read and execute SQL commands from a file.
fieldExists( $table, $field, $fname=__METHOD__)
Determines whether a field exists in a table.
indexExists( $table, $index, $fname=__METHOD__)
Determines whether an index exists.
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.