3 namespace Wikimedia\Rdbms
;
6 * Helper class to handle automatically marking connections as reusable (via RAII pattern)
7 * as well handling deferring the actual network connection until the handle is used
9 * @note: proxy methods are defined explicity to avoid interface errors
13 class MaintainableDBConnRef
extends DBConnRef
implements IMaintainableDatabase
{
14 public function tableName( $name, $format = 'quoted' ) {
15 return $this->__call( __FUNCTION__
, func_get_args() );
18 public function tableNames() {
19 return $this->__call( __FUNCTION__
, func_get_args() );
22 public function tableNamesN() {
23 return $this->__call( __FUNCTION__
, func_get_args() );
26 public function sourceFile(
28 callable
$lineCallback = null,
29 callable
$resultCallback = null,
31 callable
$inputCallback = null
33 $this->assertRoleAllowsWrites();
35 return $this->__call( __FUNCTION__
, func_get_args() );
38 public function sourceStream(
40 callable
$lineCallback = null,
41 callable
$resultCallback = null,
43 callable
$inputCallback = null
45 $this->assertRoleAllowsWrites();
47 return $this->__call( __FUNCTION__
, func_get_args() );
50 public function dropTable( $tableName, $fName = __METHOD__
) {
51 $this->assertRoleAllowsWrites();
53 return $this->__call( __FUNCTION__
, func_get_args() );
56 public function deadlockLoop() {
57 $this->assertRoleAllowsWrites();
59 return $this->__call( __FUNCTION__
, func_get_args() );
62 public function listViews( $prefix = null, $fname = __METHOD__
) {
63 return $this->__call( __FUNCTION__
, func_get_args() );
66 public function textFieldSize( $table, $field ) {
67 return $this->__call( __FUNCTION__
, func_get_args() );
70 public function streamStatementEnd( &$sql, &$newLine ) {
71 return $this->__call( __FUNCTION__
, func_get_args() );
74 public function duplicateTableStructure(
75 $oldName, $newName, $temporary = false, $fname = __METHOD__
77 $this->assertRoleAllowsWrites();
79 return $this->__call( __FUNCTION__
, func_get_args() );
82 public function tableLocksHaveTransactionScope() {
83 return $this->__call( __FUNCTION__
, func_get_args() );
86 public function lockTables( array $read, array $write, $method ) {
87 $this->assertRoleAllowsWrites();
89 return $this->__call( __FUNCTION__
, func_get_args() );
92 public function unlockTables( $method ) {
93 $this->assertRoleAllowsWrites();
95 return $this->__call( __FUNCTION__
, func_get_args() );
98 public function indexUnique( $table, $index ) {
99 return $this->__call( __FUNCTION__
, func_get_args() );
102 public function listTables( $prefix = null, $fname = __METHOD__
) {
103 return $this->__call( __FUNCTION__
, func_get_args() );
106 public function fieldInfo( $table, $field ) {
107 return $this->__call( __FUNCTION__
, func_get_args() );
112 * @deprecated since 1.33
114 class_alias( MaintainableDBConnRef
::class, 'MaintainableDBConnRef' );