MediaWiki  master
IDatabase.php
Go to the documentation of this file.
1 <?php
20 namespace Wikimedia\Rdbms;
21 
26 
38 interface IDatabase {
40  const TRIGGER_IDLE = 1;
42  const TRIGGER_COMMIT = 2;
44  const TRIGGER_ROLLBACK = 3;
45 
47  const TRANSACTION_EXPLICIT = '';
49  const TRANSACTION_INTERNAL = 'implicit';
50 
52  const ATOMIC_NOT_CANCELABLE = '';
54  const ATOMIC_CANCELABLE = 'cancelable';
55 
57  const FLUSHING_ONE = '';
59  const FLUSHING_ALL_PEERS = 'flush';
61  const FLUSHING_INTERNAL = 'flush-internal';
62 
64  const REMEMBER_NOTHING = '';
66  const REMEMBER_PRIOR = 'remember';
68  const RESTORE_PRIOR = 'prior';
70  const RESTORE_INITIAL = 'initial';
71 
73  const ESTIMATE_TOTAL = 'total';
75  const ESTIMATE_DB_APPLY = 'apply';
76 
78  const LIST_COMMA = 0;
80  const LIST_AND = 1;
82  const LIST_SET = 2;
84  const LIST_NAMES = 3;
86  const LIST_OR = 4;
87 
89  const DBO_DEBUG = 1;
91  const DBO_NOBUFFER = 2;
93  const DBO_IGNORE = 4;
95  const DBO_TRX = 8;
97  const DBO_DEFAULT = 16;
99  const DBO_PERSISTENT = 32;
101  const DBO_SYSDBA = 64;
103  const DBO_DDLMODE = 128;
105  const DBO_SSL = 256;
107  const DBO_COMPRESS = 512;
108 
116  public function getServerInfo();
117 
138  public function bufferResults( $buffer = null );
139 
148  public function trxLevel();
149 
159  public function trxTimestamp();
160 
165  public function explicitTrxActive();
166 
172  public function assertNoOpenTransactions();
173 
180  public function tablePrefix( $prefix = null );
181 
187  public function dbSchema( $schema = null );
188 
198  public function getLBInfo( $name = null );
199 
208  public function setLBInfo( $name, $value = null );
209 
216  public function setLazyMasterHandle( IDatabase $conn );
217 
224  public function implicitGroupby();
225 
232  public function implicitOrderby();
233 
238  public function lastQuery();
239 
247  public function doneWrites();
248 
256  public function lastDoneWrites();
257 
262  public function writesPending();
263 
268  public function preCommitCallbacksPending();
269 
278  public function writesOrCallbacksPending();
279 
289  public function pendingWriteQueryDuration( $type = self::ESTIMATE_TOTAL );
290 
297  public function pendingWriteCallers();
298 
305  public function pendingWriteRowsAffected();
306 
311  public function isOpen();
312 
325  public function setFlag( $flag, $remember = self::REMEMBER_NOTHING );
326 
339  public function clearFlag( $flag, $remember = self::REMEMBER_NOTHING );
340 
347  public function restoreFlags( $state = self::RESTORE_PRIOR );
348 
359  public function getFlag( $flag );
360 
368  public function getDomainID();
369 
376  public function getWikiID();
377 
383  public function getType();
384 
395  public function fetchObject( $res );
396 
406  public function fetchRow( $res );
407 
415  public function numRows( $res );
416 
424  public function numFields( $res );
425 
434  public function fieldName( $res, $n );
435 
445  public function insertId();
446 
454  public function dataSeek( $res, $row );
455 
462  public function lastErrno();
463 
470  public function lastError();
471 
478  public function affectedRows();
479 
488  public function getSoftwareLink();
489 
496  public function getServerVersion();
497 
508  public function close();
509 
536  public function query( $sql, $fname = __METHOD__, $tempIgnore = false );
537 
545  public function freeResult( $res );
546 
566  public function selectField(
567  $table, $var, $cond = '', $fname = __METHOD__, $options = [], $join_conds = []
568  );
569 
590  public function selectFieldValues(
591  $table, $var, $cond = '', $fname = __METHOD__, $options = [], $join_conds = []
592  );
593 
755  public function select(
756  $table, $vars, $conds = '', $fname = __METHOD__,
757  $options = [], $join_conds = []
758  );
759 
776  public function selectSQLText(
777  $table, $vars, $conds = '', $fname = __METHOD__,
778  $options = [], $join_conds = []
779  );
780 
796  public function selectRow( $table, $vars, $conds, $fname = __METHOD__,
797  $options = [], $join_conds = []
798  );
799 
822  public function estimateRowCount(
823  $table, $var = '*', $conds = '', $fname = __METHOD__, $options = [], $join_conds = []
824  );
825 
844  public function selectRowCount(
845  $tables, $var = '*', $conds = '', $fname = __METHOD__, $options = [], $join_conds = []
846  );
847 
859  public function lockForUpdate(
860  $table, $conds = '', $fname = __METHOD__, $options = [], $join_conds = []
861  );
862 
872  public function fieldExists( $table, $field, $fname = __METHOD__ );
873 
885  public function indexExists( $table, $index, $fname = __METHOD__ );
886 
895  public function tableExists( $table, $fname = __METHOD__ );
896 
930  public function insert( $table, $a, $fname = __METHOD__, $options = [] );
931 
953  public function update( $table, $values, $conds, $fname = __METHOD__, $options = [] );
954 
980  public function makeList( $a, $mode = self::LIST_COMMA );
981 
992  public function makeWhereFrom2d( $data, $baseKey, $subKey );
993 
1002  public function aggregateValue( $valuedata, $valuename = 'value' );
1003 
1008  public function bitNot( $field );
1009 
1015  public function bitAnd( $fieldLeft, $fieldRight );
1016 
1022  public function bitOr( $fieldLeft, $fieldRight );
1023 
1030  public function buildConcat( $stringList );
1031 
1048  public function buildGroupConcatField(
1049  $delim, $table, $field, $conds = '', $join_conds = []
1050  );
1051 
1064  public function buildSubString( $input, $startPosition, $length = null );
1065 
1071  public function buildStringCast( $field );
1072 
1078  public function buildIntegerCast( $field );
1079 
1094  public function buildSelectSubquery(
1095  $table, $vars, $conds = '', $fname = __METHOD__,
1096  $options = [], $join_conds = []
1097  );
1098 
1110  public function databasesAreIndependent();
1111 
1123  public function selectDB( $db );
1124 
1136  public function selectDomain( $domain );
1137 
1142  public function getDBname();
1143 
1148  public function getServer();
1149 
1156  public function addQuotes( $s );
1157 
1174  public function buildLike();
1175 
1181  public function anyChar();
1182 
1188  public function anyString();
1189 
1206  public function nextSequenceValue( $seqName );
1207 
1231  public function replace( $table, $uniqueIndexes, $rows, $fname = __METHOD__ );
1232 
1270  public function upsert(
1271  $table, array $rows, array $uniqueIndexes, array $set, $fname = __METHOD__
1272  );
1273 
1294  public function deleteJoin( $delTable, $joinTable, $delVar, $joinVar, $conds,
1295  $fname = __METHOD__
1296  );
1297 
1309  public function delete( $table, $conds, $fname = __METHOD__ );
1310 
1347  public function insertSelect( $destTable, $srcTable, $varMap, $conds,
1348  $fname = __METHOD__,
1349  $insertOptions = [], $selectOptions = [], $selectJoinConds = []
1350  );
1351 
1357  public function unionSupportsOrderAndLimit();
1358 
1367  public function unionQueries( $sqls, $all );
1368 
1395  public function unionConditionPermutations(
1396  $table, $vars, array $permute_conds, $extra_conds = '', $fname = __METHOD__,
1397  $options = [], $join_conds = []
1398  );
1399 
1409  public function conditional( $cond, $trueVal, $falseVal );
1410 
1421  public function strreplace( $orig, $old, $new );
1422 
1429  public function getServerUptime();
1430 
1438  public function wasDeadlock();
1439 
1447  public function wasLockTimeout();
1448 
1457  public function wasConnectionLoss();
1458 
1464  public function wasReadOnlyError();
1465 
1473  public function wasErrorReissuable();
1474 
1489  public function masterPosWait( DBMasterPos $pos, $timeout );
1490 
1497  public function getReplicaPos();
1498 
1505  public function getMasterPos();
1506 
1511  public function serverIsReadOnly();
1512 
1532  public function onTransactionResolution( callable $callback, $fname = __METHOD__ );
1533 
1566  public function onTransactionCommitOrIdle( callable $callback, $fname = __METHOD__ );
1567 
1577  public function onTransactionIdle( callable $callback, $fname = __METHOD__ );
1578 
1602  public function onTransactionPreCommitOrIdle( callable $callback, $fname = __METHOD__ );
1603 
1622  public function setTransactionListener( $name, callable $callback = null );
1623 
1698  public function startAtomic( $fname = __METHOD__, $cancelable = self::ATOMIC_NOT_CANCELABLE );
1699 
1711  public function endAtomic( $fname = __METHOD__ );
1712 
1738  public function cancelAtomic( $fname = __METHOD__, AtomicSectionIdentifier $sectionId = null );
1739 
1812  public function doAtomicSection(
1813  $fname, callable $callback, $cancelable = self::ATOMIC_NOT_CANCELABLE
1814  );
1815 
1836  public function begin( $fname = __METHOD__, $mode = self::TRANSACTION_EXPLICIT );
1837 
1858  public function commit( $fname = __METHOD__, $flush = '' );
1859 
1880  public function rollback( $fname = __METHOD__, $flush = '' );
1881 
1894  public function flushSnapshot( $fname = __METHOD__ );
1895 
1907  public function timestamp( $ts = 0 );
1908 
1922  public function timestampOrNull( $ts = null );
1923 
1930  public function ping( &$rtt = null );
1931 
1940  public function getLag();
1941 
1956  public function getSessionLagStatus();
1957 
1963  public function maxListLen();
1964 
1974  public function encodeBlob( $b );
1975 
1984  public function decodeBlob( $b );
1985 
1997  public function setSessionOptions( array $options );
1998 
2006  public function setSchemaVars( $vars );
2007 
2017  public function lockIsFree( $lockName, $method );
2018 
2030  public function lock( $lockName, $method, $timeout = 5 );
2031 
2046  public function unlock( $lockName, $method );
2047 
2069  public function getScopedLockAndFlush( $lockKey, $fname, $timeout );
2070 
2077  public function namedLocksEnqueue();
2078 
2086  public function getInfinity();
2087 
2094  public function encodeExpiry( $expiry );
2095 
2103  public function decodeExpiry( $expiry, $format = TS_MW );
2104 
2114  public function setBigSelects( $value = true );
2115 
2120  public function isReadOnly();
2121 
2135  public function setTableAliases( array $aliases );
2136 
2150  public function setIndexAliases( array $aliases );
2151 }
2152 
2156 class_alias( IDatabase::class, 'IDatabase' );
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))
selectDB( $db)
Change the current database.
const DBO_IGNORE
Definition: defines.php:11
buildSelectSubquery( $table, $vars, $conds='', $fname=__METHOD__, $options=[], $join_conds=[])
Equivalent to IDatabase::selectSQLText() except wraps the result in Subqyery.
implicitGroupby()
Returns true if this database does an implicit sort when doing GROUP BY.
close()
Close the database connection.
aggregateValue( $valuedata, $valuename='value')
Return aggregated value alias.
pendingWriteCallers()
Get the list of method names that did write queries for this transaction.
do that in ParserLimitReportFormat instead use this to modify the parameters of the image all existing parser cache entries will be invalid To avoid you ll need to handle that somehow(e.g. with the RejectParserCacheValue hook) because MediaWiki won 't do it for you. & $defaults also a ContextSource after deleting those rows but within the same transaction $rows
Definition: hooks.txt:2625
dbSchema( $schema=null)
Get/set the db schema.
insertSelect( $destTable, $srcTable, $varMap, $conds, $fname=__METHOD__, $insertOptions=[], $selectOptions=[], $selectJoinConds=[])
INSERT SELECT wrapper.
getServerInfo()
A string describing the current software version, and possibly other details in a user-friendly way...
deleteJoin( $delTable, $joinTable, $delVar, $joinVar, $conds, $fname=__METHOD__)
DELETE where the condition is a join.
selectDomain( $domain)
Set the current domain (database, schema, and table prefix)
setSessionOptions(array $options)
Override database&#39;s default behavior.
conditional( $cond, $trueVal, $falseVal)
Returns an SQL expression for a simple conditional.
fetchObject( $res)
Fetch the next row from the given result object, in object form.
affectedRows()
Get the number of rows affected by the last write query.
getServerUptime()
Determines how long the server has been up.
if(is_array( $mode)) switch( $mode) $input
timestampOrNull( $ts=null)
Convert a timestamp in one of the formats accepted by wfTimestamp() to the format used for inserting ...
selectField( $table, $var, $cond='', $fname=__METHOD__, $options=[], $join_conds=[])
A SELECT wrapper which returns a single field from a single result row.
lastErrno()
Get the last error number.
getLBInfo( $name=null)
Get properties passed down from the server info array of the load balancer.
maxListLen()
Return the maximum number of items allowed in a list, or 0 for unlimited.
getInfinity()
Find out when &#39;infinity&#39; is.
numFields( $res)
Get the number of fields in a result object.
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for use
unionSupportsOrderAndLimit()
Returns true if current database backend supports ORDER BY or LIMIT for separate subqueries within th...
pendingWriteRowsAffected()
Get the number of affected rows from pending write queries.
namedLocksEnqueue()
Check to see if a named lock used by lock() use blocking queues.
const LIST_NAMES
Definition: Defines.php:45
numRows( $res)
Get the number of rows in a query result.
insert( $table, $a, $fname=__METHOD__, $options=[])
INSERT wrapper, inserts an array into a table.
lock( $lockName, $method, $timeout=5)
Acquire a named lock.
getWikiID()
Alias for getDomainID()
getSessionLagStatus()
Get the replica DB lag when the current transaction started or a general lag estimate if not transact...
$value
isOpen()
Is a connection to the database open?
getMasterPos()
Get the position of this master.
endAtomic( $fname=__METHOD__)
Ends an atomic section of SQL statements.
encodeBlob( $b)
Some DBMSs have a special format for inserting into blob fields, they don&#39;t allow simple quoted strin...
getLag()
Get the amount of replication lag for this database server.
buildLike()
LIKE statement wrapper, receives a variable-length argument list with parts of pattern to match conta...
databasesAreIndependent()
Returns true if DBs are assumed to be on potentially different servers.
insertId()
Get the inserted value of an auto-increment row.
implicitOrderby()
Returns true if this database does an implicit order by when the column has an index For example: SEL...
trxLevel()
Gets the current transaction level.
wasDeadlock()
Determines if the last failure was due to a deadlock.
getDomainID()
Return the currently selected domain ID.
estimateRowCount( $table, $var=' *', $conds='', $fname=__METHOD__, $options=[], $join_conds=[])
Estimate the number of rows in dataset.
const DBO_DDLMODE
Definition: defines.php:16
this hook is for auditing only RecentChangesLinked and Watchlist Do not use this to implement individual filters if they are compatible with the ChangesListFilter and ChangesListFilterGroup structure use sub classes of those in conjunction with the ChangesListSpecialPageStructuredFilters hook This hook can be used to implement filters that do not implement that or custom behavior that is not an individual filter e g Watchlist & $tables
Definition: hooks.txt:989
wasErrorReissuable()
Determines if the last query error was due to something outside of the query itself.
getServerVersion()
A string describing the current software version, like from mysql_get_server_info().
rollback( $fname=__METHOD__, $flush='')
Rollback a transaction previously started using begin().
timestamp( $ts=0)
Convert a timestamp in one of the formats accepted by wfTimestamp() to the format used for inserting ...
anyString()
Returns a token for buildLike() that denotes a &#39;&#39; to be used in a LIKE query.
pendingWriteQueryDuration( $type=self::ESTIMATE_TOTAL)
Get the time spend running write queries for this transaction.
const DBO_PERSISTENT
Definition: defines.php:14
begin( $fname=__METHOD__, $mode=self::TRANSACTION_EXPLICIT)
Begin a transaction.
writesOrCallbacksPending()
Whether there is a transaction open with either possible write queries or unresolved pre-commit/commi...
setLBInfo( $name, $value=null)
Set the LB info array, or a member of it.
unionQueries( $sqls, $all)
Construct a UNION query This is used for providing overload point for other DB abstractions not compa...
selectRow( $table, $vars, $conds, $fname=__METHOD__, $options=[], $join_conds=[])
Single row SELECT wrapper.
bitAnd( $fieldLeft, $fieldRight)
cancelAtomic( $fname=__METHOD__, AtomicSectionIdentifier $sectionId=null)
Cancel an atomic section of SQL statements.
assertNoOpenTransactions()
Assert that all explicit transactions or atomic sections have been closed.
getScopedLockAndFlush( $lockKey, $fname, $timeout)
Acquire a named lock, flush any transaction, and return an RAII style unlocker object.
lastDoneWrites()
Returns the last time the connection may have been used for write queries.
setSchemaVars( $vars)
Set variables to be used in sourceFile/sourceStream, in preference to the ones in $GLOBALS...
const DBO_DEBUG
Definition: defines.php:9
const LIST_AND
Definition: Defines.php:43
getReplicaPos()
Get the replication position of this replica DB.
const DBO_SYSDBA
Definition: defines.php:15
An object representing a master or replica DB position in a replicated setup.
Definition: DBMasterPos.php:12
bufferResults( $buffer=null)
Turns buffering of SQL result sets on (true) or off (false).
const LIST_COMMA
Definition: Defines.php:42
onTransactionIdle(callable $callback, $fname=__METHOD__)
Alias for onTransactionCommitOrIdle() for backwards-compatibility.
$res
Definition: database.txt:21
makeWhereFrom2d( $data, $baseKey, $subKey)
Build a partial where clause from a 2-d array such as used for LinkBatch.
buildConcat( $stringList)
Build a concatenation list to feed into a SQL query.
getDBname()
Get the current DB name.
fieldName( $res, $n)
Get a field name in a result object.
bitOr( $fieldLeft, $fieldRight)
dataSeek( $res, $row)
Change the position of the cursor in a result object.
wasLockTimeout()
Determines if the last failure was due to a lock timeout.
wasReadOnlyError()
Determines if the last failure was due to the database being read-only.
unionConditionPermutations( $table, $vars, array $permute_conds, $extra_conds='', $fname=__METHOD__, $options=[], $join_conds=[])
Construct a UNION query for permutations of conditions.
getSoftwareLink()
Returns a wikitext link to the DB&#39;s website, e.g., return "[https://www.mysql.com/ MySQL]"; Should at...
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped & $options
Definition: hooks.txt:1995
encodeExpiry( $expiry)
Encode an expiry time into the DBMS dependent format.
selectSQLText( $table, $vars, $conds='', $fname=__METHOD__, $options=[], $join_conds=[])
The equivalent of IDatabase::select() except that the constructed SQL is returned, instead of being immediately executed.
setLazyMasterHandle(IDatabase $conn)
Set a lazy-connecting DB handle to the master DB (for replication status purposes) ...
onTransactionPreCommitOrIdle(callable $callback, $fname=__METHOD__)
Run a callback before the current transaction commits or now if there is none.
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that When $user is not null
Definition: hooks.txt:780
lastError()
Get a description of the last error.
$buffer
lastQuery()
Return the last query that went through IDatabase::query()
selectRowCount( $tables, $var=' *', $conds='', $fname=__METHOD__, $options=[], $join_conds=[])
Get the number of rows in dataset.
wasConnectionLoss()
Determines if the last query error was due to a dropped connection.
commit( $fname=__METHOD__, $flush='')
Commits a transaction previously started using begin().
decodeExpiry( $expiry, $format=TS_MW)
Decode an expiry time into a DBMS independent format.
strreplace( $orig, $old, $new)
Returns a command for str_replace function in SQL query.
lockIsFree( $lockName, $method)
Check to see if a named lock is not locked by any thread (non-blocking)
setTransactionListener( $name, callable $callback=null)
Run a callback after each time any transaction commits or rolls back.
buildSubString( $input, $startPosition, $length=null)
Build a SUBSTRING function.
if(defined( 'MW_SETUP_CALLBACK')) $fname
Customization point after all loading (constants, functions, classes, DefaultSettings, LocalSettings).
Definition: Setup.php:121
const LIST_SET
Definition: Defines.php:44
const LIST_OR
Definition: Defines.php:46
const DBO_TRX
Definition: defines.php:12
query( $sql, $fname=__METHOD__, $tempIgnore=false)
Run an SQL query and return the result.
setFlag( $flag, $remember=self::REMEMBER_NOTHING)
Set a flag for this connection.
upsert( $table, array $rows, array $uniqueIndexes, array $set, $fname=__METHOD__)
INSERT ON DUPLICATE KEY UPDATE wrapper, upserts an array into a table.
const DBO_NOBUFFER
Definition: defines.php:10
setIndexAliases(array $aliases)
Convert certain index names to alternative names before querying the DB.
masterPosWait(DBMasterPos $pos, $timeout)
Wait for the replica DB to catch up to a given master position.
setBigSelects( $value=true)
Allow or deny "big selects" for this session only.
anyChar()
Returns a token for buildLike() that denotes a &#39;_&#39; to be used in a LIKE query.
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
Definition: injection.txt:35
const DBO_DEFAULT
Definition: defines.php:13
selectFieldValues( $table, $var, $cond='', $fname=__METHOD__, $options=[], $join_conds=[])
A SELECT wrapper which returns a list of single field values from result rows.
getType()
Get the type of the DBMS, as it appears in $wgDBtype.
doAtomicSection( $fname, callable $callback, $cancelable=self::ATOMIC_NOT_CANCELABLE)
Perform an atomic section of reversable SQL statements from a callback.
buildGroupConcatField( $delim, $table, $field, $conds='', $join_conds=[])
Build a GROUP_CONCAT or equivalent statement for a query.
Basic database interface for live and lazy-loaded relation database handles.
Definition: IDatabase.php:38
setTableAliases(array $aliases)
Make certain table names use their own database, schema, and table prefix when passed into SQL querie...
indexExists( $table, $index, $fname=__METHOD__)
Determines whether an index exists Usually throws a DBQueryError on failure If errors are explicitly ...
startAtomic( $fname=__METHOD__, $cancelable=self::ATOMIC_NOT_CANCELABLE)
Begin an atomic section of SQL statements.
you have access to all of the normal MediaWiki so you can get a DB use the etc For full docs on the Maintenance class
Definition: maintenance.txt:52
makeList( $a, $mode=self::LIST_COMMA)
Makes an encoded list of strings from an array.
getFlag( $flag)
Returns a boolean whether the flag $flag is set for this connection.
freeResult( $res)
Free a result object returned by query() or select().
getServer()
Get the server hostname or IP address.
select( $table, $vars, $conds='', $fname=__METHOD__, $options=[], $join_conds=[])
Execute a SELECT query constructed using the various parameters provided.
restoreFlags( $state=self::RESTORE_PRIOR)
Restore the flags to their prior state before the last setFlag/clearFlag call.
replace( $table, $uniqueIndexes, $rows, $fname=__METHOD__)
REPLACE query wrapper.
lockForUpdate( $table, $conds='', $fname=__METHOD__, $options=[], $join_conds=[])
Lock all rows meeting the given conditions/options FOR UPDATE.
Allows to change the fields on the form that will be generated $name
Definition: hooks.txt:271
onTransactionResolution(callable $callback, $fname=__METHOD__)
Run a callback as soon as the current transaction commits or rolls back.
update( $table, $values, $conds, $fname=__METHOD__, $options=[])
UPDATE wrapper.
trxTimestamp()
Get the UNIX timestamp of the time that the transaction was established.
unlock( $lockName, $method)
Release a lock.
Class used for token representing identifiers for atomic sections from IDatabase instances.
doneWrites()
Returns true if the connection may have been used for write queries.
fetchRow( $res)
Fetch the next row from the given result object, in associative array form.
const DBO_SSL
Definition: defines.php:17
addQuotes( $s)
Adds quotes and backslashes.
tablePrefix( $prefix=null)
Get/set the table prefix.
fieldExists( $table, $field, $fname=__METHOD__)
Determines whether a field exists in a table.
onTransactionCommitOrIdle(callable $callback, $fname=__METHOD__)
Run a callback as soon as there is no transaction pending.
const DBO_COMPRESS
Definition: defines.php:18
static configuration should be added through ResourceLoaderGetConfigVars instead & $vars
Definition: hooks.txt:2220
flushSnapshot( $fname=__METHOD__)
Commit any transaction but error out if writes or callbacks are pending.
clearFlag( $flag, $remember=self::REMEMBER_NOTHING)
Clear a flag for this connection.
tableExists( $table, $fname=__METHOD__)
Query whether a given table exists.
nextSequenceValue( $seqName)
Deprecated method, calls should be removed.
ping(&$rtt=null)
Ping the server and try to reconnect if it there is no connection.
decodeBlob( $b)
Some DBMSs return a special placeholder object representing blob fields in result objects...