MediaWiki REL1_40
IReadableDatabase.php
Go to the documentation of this file.
1<?php
20namespace Wikimedia\Rdbms;
21
22use stdClass;
26
41 public function getServerInfo();
42
49 public function tablePrefix( $prefix = null );
50
57 public function dbSchema( $schema = null );
58
65 public function lastQuery();
66
70 public function isOpen();
71
79 public function getDomainID();
80
86 public function getType();
87
93 public function lastErrno();
94
100 public function lastError();
101
109 public function getSoftwareLink();
110
116 public function getServerVersion();
117
131 public function close( $fname = __METHOD__ );
132
144
164 public function selectField(
165 $table, $var, $cond = '', $fname = __METHOD__, $options = [], $join_conds = []
166 );
167
188 public function selectFieldValues(
189 $table, $var, $cond = '', $fname = __METHOD__, $options = [], $join_conds = []
190 ): array;
191
375 public function select(
376 $table,
377 $vars,
378 $conds = '',
379 $fname = __METHOD__,
380 $options = [],
381 $join_conds = []
382 );
383
403 public function selectRow(
404 $table,
405 $vars,
406 $conds,
407 $fname = __METHOD__,
408 $options = [],
409 $join_conds = []
410 );
411
437 public function estimateRowCount(
438 $tables, $var = '*', $conds = '', $fname = __METHOD__, $options = [], $join_conds = []
439 );
440
462 public function selectRowCount(
463 $tables, $var = '*', $conds = '', $fname = __METHOD__, $options = [], $join_conds = []
464 );
465
478 public function databasesAreIndependent();
479
492 public function selectDomain( $domain );
493
499 public function getDBname();
500
506 public function getServer();
507
514 public function getServerName();
515
523 public function wasDeadlock();
524
532 public function wasLockTimeout();
533
542 public function wasConnectionLoss();
543
549 public function wasReadOnlyError();
550
559 public function wasErrorReissuable();
560
578 public function primaryPosWait( DBPrimaryPos $pos, $timeout );
579
586 public function getReplicaPos();
587
593 public function ping();
594
603 public function getLag();
604
619 public function getSessionLagStatus();
620
631 public function encodeBlob( $b );
632
642 public function decodeBlob( $b );
643
651 public function __toString();
652}
A query builder for SELECT queries with a fluent interface.
An object representing a primary or replica DB position in a replicated setup.
A database connection without write operations.
getSessionLagStatus()
Get the replica server lag when the current transaction started or a general lag estimate if not tran...
ping()
Ping the server and try to reconnect if it there is no connection.
close( $fname=__METHOD__)
Close the database connection.
getServerVersion()
A string describing the current software version, like from mysql_get_server_info()
getType()
Get the RDBMS type of the server (e.g.
newSelectQueryBuilder()
Create an empty SelectQueryBuilder which can be used to run queries against this connection.
encodeBlob( $b)
Some DBMSs have a special format for inserting into blob fields, they don't allow simple quoted strin...
getDBname()
Get the current database name; null if there isn't one.
selectDomain( $domain)
Set the current domain (database, schema, and table prefix)
selectRowCount( $tables, $var=' *', $conds='', $fname=__METHOD__, $options=[], $join_conds=[])
Get the number of rows in dataset.
decodeBlob( $b)
Some DBMSs return a special placeholder object representing blob fields in result objects.
lastQuery()
Get the last query that sent on account of IDatabase::query()
dbSchema( $schema=null)
Get/set the db schema.
wasDeadlock()
Determines if the last failure was due to a deadlock.
lastErrno()
Get the RDBMS-specific error code from the last attempted query statement.
select( $table, $vars, $conds='', $fname=__METHOD__, $options=[], $join_conds=[])
Execute a SELECT query constructed using the various parameters provided.
selectField( $table, $var, $cond='', $fname=__METHOD__, $options=[], $join_conds=[])
A SELECT wrapper which returns a single field from a single result row.
wasErrorReissuable()
Determines if the last query error was due to something outside of the query itself.
lastError()
Get the RDBMS-specific error description from the last attempted query statement.
tablePrefix( $prefix=null)
Get/set the table prefix.
getServer()
Get the hostname or IP address of the server.
getSoftwareLink()
Returns a wikitext style link to the DB's website (e.g.
wasReadOnlyError()
Determines if the last failure was due to the database being read-only.
getLag()
Get the amount of replication lag for this database server.
wasLockTimeout()
Determines if the last failure was due to a lock timeout.
estimateRowCount( $tables, $var=' *', $conds='', $fname=__METHOD__, $options=[], $join_conds=[])
Estimate the number of rows in dataset.
selectFieldValues( $table, $var, $cond='', $fname=__METHOD__, $options=[], $join_conds=[])
A SELECT wrapper which returns a list of single field values from result rows.
getServerName()
Get the readable name for the server.
getServerInfo()
Get a human-readable string describing the current software version.
selectRow( $table, $vars, $conds, $fname=__METHOD__, $options=[], $join_conds=[])
Wrapper to IDatabase::select() that only fetches one row (via LIMIT)
wasConnectionLoss()
Determines if the last query error was due to a dropped connection.
getDomainID()
Return the currently selected domain ID.
databasesAreIndependent()
Returns true if DBs are assumed to be on potentially different servers.
getReplicaPos()
Get the replication position of this replica DB.
primaryPosWait(DBPrimaryPos $pos, $timeout)
Wait for the replica server to catch up to a given primary server position.
__toString()
Get a debugging string that mentions the database type, the ID of this instance, and the ID of any un...
Interface for query language.