MediaWiki master
IMaintainableDatabase.php
Go to the documentation of this file.
1<?php
6namespace Wikimedia\Rdbms;
7
8use Exception;
9use RuntimeException;
10
37 public function sourceFile(
38 $filename,
39 ?callable $lineCallback = null,
40 ?callable $resultCallback = null,
41 $fname = false,
42 ?callable $inputCallback = null
43 );
44
58 public function sourceStream(
59 $fp,
60 ?callable $lineCallback = null,
61 ?callable $resultCallback = null,
62 $fname = __METHOD__,
63 ?callable $inputCallback = null
64 );
65
73 public function streamStatementEnd( &$sql, &$newLine );
74
83 public function dropTable( $table, $fname = __METHOD__ );
84
93 public function truncateTable( $table, $fname = __METHOD__ );
94
110 public function duplicateTableStructure(
111 $oldName, $newName, $temporary = false, $fname = __METHOD__
112 );
113
124 public function listTables( $prefix = null, $fname = __METHOD__ );
125
135 public function fieldInfo( $table, $field );
136
146 public function fieldExists( $table, $field, $fname = __METHOD__ );
147
157 public function indexExists( $table, $index, $fname = __METHOD__ );
158
168 public function indexUnique( $table, $index, $fname = __METHOD__ );
169
178 public function tableExists( $table, $fname = __METHOD__ );
179
190 public function getPrimaryKeyColumns( $table, $fname = __METHOD__ );
191}
Interface to a relational database.
Definition IDatabase.php:31
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.
getPrimaryKeyColumns( $table, $fname=__METHOD__)
Get the primary key columns of a 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.