MediaWiki REL1_37
IDatabase.php
Go to the documentation of this file.
1<?php
20namespace Wikimedia\Rdbms;
21
22use Exception;
23use InvalidArgumentException;
24use stdClass;
25use Wikimedia\ScopedCallback;
26
38interface IDatabase {
40 public const TRIGGER_IDLE = 1;
42 public const TRIGGER_COMMIT = 2;
44 public const TRIGGER_ROLLBACK = 3;
46 public const TRIGGER_CANCEL = 4;
47
49 public const TRANSACTION_EXPLICIT = '';
51 public const TRANSACTION_INTERNAL = 'implicit';
52
54 public const ATOMIC_NOT_CANCELABLE = '';
56 public const ATOMIC_CANCELABLE = 'cancelable';
57
59 public const FLUSHING_ONE = '';
61 public const FLUSHING_ALL_PEERS = 'flush';
63 public const FLUSHING_INTERNAL = 'flush-internal';
64
66 public const REMEMBER_NOTHING = '';
68 public const REMEMBER_PRIOR = 'remember';
70 public const RESTORE_PRIOR = 'prior';
72 public const RESTORE_INITIAL = 'initial';
73
75 public const ESTIMATE_TOTAL = 'total';
77 public const ESTIMATE_DB_APPLY = 'apply';
78
80 public const LIST_COMMA = 0;
82 public const LIST_AND = 1;
84 public const LIST_SET = 2;
86 public const LIST_NAMES = 3;
88 public const LIST_OR = 4;
89
91 public const DBO_DEBUG = 1;
93 public const DBO_NOBUFFER = 2;
95 public const DBO_IGNORE = 4;
97 public const DBO_TRX = 8;
99 public const DBO_DEFAULT = 16;
101 public const DBO_PERSISTENT = 32;
103 public const DBO_SYSDBA = 64;
105 public const DBO_DDLMODE = 128;
107 public const DBO_SSL = 256;
109 public const DBO_COMPRESS = 512;
110
112 public const QUERY_NORMAL = 0;
114 public const QUERY_SILENCE_ERRORS = 1; // b/c for 1.32 query() argument; (int)true = 1
119 public const QUERY_PSEUDO_PERMANENT = 2;
121 public const QUERY_REPLICA_ROLE = 4;
123 public const QUERY_IGNORE_DBO_TRX = 8;
125 public const QUERY_NO_RETRY = 16;
127 public const QUERY_CHANGE_NONE = 32;
129 public const QUERY_CHANGE_TRX = 64 | self::QUERY_IGNORE_DBO_TRX;
131 public const QUERY_CHANGE_ROWS = 128;
133 public const QUERY_CHANGE_SCHEMA = 256 | self::QUERY_IGNORE_DBO_TRX;
134
136 public const LOCK_TIMESTAMP = 1;
137
139 public const UNION_ALL = true;
141 public const UNION_DISTINCT = false;
142
144 public const LB_TRX_ROUND_ID = 'trxRoundId';
146 public const LB_READ_ONLY_REASON = 'readOnlyReason';
147
149 public const ROLE_STREAMING_MASTER = 'streaming-master';
151 public const ROLE_STREAMING_REPLICA = 'streaming-replica';
153 public const ROLE_STATIC_CLONE = 'static-clone';
155 public const ROLE_UNKNOWN = 'unknown';
156
158 public const ALL_ROWS = '*';
159
167 public function getServerInfo();
168
180 public function getTopologyBasedServerId();
181
193 public function getTopologyRole();
194
206 public function getTopologyRootPrimary();
207
214 public function getTopologyRootMaster();
215
224 public function trxLevel();
225
237 public function trxTimestamp();
238
243 public function explicitTrxActive();
244
251 public function assertNoOpenTransactions();
252
259 public function tablePrefix( $prefix = null );
260
267 public function dbSchema( $schema = null );
268
275 public function getLBInfo( $name = null );
276
285 public function setLBInfo( $nameOrArray, $value = null );
286
293 public function implicitOrderby();
294
300 public function lastQuery();
301
308 public function lastDoneWrites();
309
314 public function writesPending();
315
320 public function preCommitCallbacksPending();
321
330 public function writesOrCallbacksPending();
331
341 public function pendingWriteQueryDuration( $type = self::ESTIMATE_TOTAL );
342
349 public function pendingWriteCallers();
350
357 public function pendingWriteRowsAffected();
358
362 public function isOpen();
363
370 public function setFlag( $flag, $remember = self::REMEMBER_NOTHING );
371
378 public function clearFlag( $flag, $remember = self::REMEMBER_NOTHING );
379
386 public function restoreFlags( $state = self::RESTORE_PRIOR );
387
394 public function getFlag( $flag );
395
403 public function getDomainID();
404
410 public function getType();
411
412 /***************************************************************************/
413 // region Deprecated IResultWrapper accessors
414
426 public function fetchObject( IResultWrapper $res );
427
439 public function fetchRow( IResultWrapper $res );
440
451 public function numRows( $res );
452
462 public function numFields( IResultWrapper $res );
463
474 public function fieldName( IResultWrapper $res, $n );
475
486 public function freeResult( IResultWrapper $res );
487
497 public function dataSeek( IResultWrapper $res, $row );
498
499 // endregion -- Deprecated IResultWrapper accessors
500 /***************************************************************************/
501
511 public function insertId();
512
519 public function lastErrno();
520
527 public function lastError();
528
537 public function affectedRows();
538
546 public function getSoftwareLink();
547
553 public function getServerVersion();
554
567 public function close( $fname = __METHOD__, $owner = null );
568
596 public function query( $sql, $fname = __METHOD__, $flags = 0 );
597
604 public function newSelectQueryBuilder();
605
622 public function selectField(
623 $table, $var, $cond = '', $fname = __METHOD__, $options = [], $join_conds = []
624 );
625
643 public function selectFieldValues(
644 $table, $var, $cond = '', $fname = __METHOD__, $options = [], $join_conds = []
645 ): array;
646
824 public function select(
825 $table,
826 $vars,
827 $conds = '',
828 $fname = __METHOD__,
829 $options = [],
830 $join_conds = []
831 );
832
850 public function selectSQLText(
851 $table,
852 $vars,
853 $conds = '',
854 $fname = __METHOD__,
855 $options = [],
856 $join_conds = []
857 );
858
875 public function selectRow(
876 $table,
877 $vars,
878 $conds,
879 $fname = __METHOD__,
880 $options = [],
881 $join_conds = []
882 );
883
906 public function estimateRowCount(
907 $tables, $var = '*', $conds = '', $fname = __METHOD__, $options = [], $join_conds = []
908 );
909
928 public function selectRowCount(
929 $tables, $var = '*', $conds = '', $fname = __METHOD__, $options = [], $join_conds = []
930 );
931
944 public function lockForUpdate(
945 $table, $conds = '', $fname = __METHOD__, $options = [], $join_conds = []
946 );
947
957 public function fieldExists( $table, $field, $fname = __METHOD__ );
958
968 public function indexExists( $table, $index, $fname = __METHOD__ );
969
978 public function tableExists( $table, $fname = __METHOD__ );
979
999 public function insert( $table, $rows, $fname = __METHOD__, $options = [] );
1000
1025 public function update( $table, $set, $conds, $fname = __METHOD__, $options = [] );
1026
1052 public function makeList( array $a, $mode = self::LIST_COMMA );
1053
1070 public function makeWhereFrom2d( $data, $baseKey, $subKey );
1071
1081 public function aggregateValue( $valuedata, $valuename = 'value' );
1082
1087 public function bitNot( $field );
1088
1094 public function bitAnd( $fieldLeft, $fieldRight );
1095
1101 public function bitOr( $fieldLeft, $fieldRight );
1102
1108 public function buildConcat( $stringList );
1109
1126 public function buildGroupConcatField(
1127 $delim, $table, $field, $conds = '', $join_conds = []
1128 );
1129
1144 public function buildGreatest( $fields, $values );
1145
1160 public function buildLeast( $fields, $values );
1161
1174 public function buildSubString( $input, $startPosition, $length = null );
1175
1181 public function buildStringCast( $field );
1182
1188 public function buildIntegerCast( $field );
1189
1204 public function buildSelectSubquery(
1205 $table,
1206 $vars,
1207 $conds = '',
1208 $fname = __METHOD__,
1209 $options = [],
1210 $join_conds = []
1211 );
1212
1230 public function limitResult( $sql, $limit, $offset = false );
1231
1244 public function databasesAreIndependent();
1245
1257 public function selectDB( $db );
1258
1271 public function selectDomain( $domain );
1272
1278 public function getDBname();
1279
1285 public function getServer();
1286
1293 public function getServerName();
1294
1301 public function addQuotes( $s );
1302
1312 public function addIdentifierQuotes( $s );
1313
1333 public function buildLike( $param, ...$params );
1334
1340 public function anyChar();
1341
1347 public function anyString();
1348
1365 public function nextSequenceValue( $seqName );
1366
1394 public function replace( $table, $uniqueKeys, $rows, $fname = __METHOD__ );
1395
1430 public function upsert(
1431 $table, array $rows, $uniqueKeys, array $set, $fname = __METHOD__
1432 );
1433
1454 public function deleteJoin(
1455 $delTable,
1456 $joinTable,
1457 $delVar,
1458 $joinVar,
1459 $conds,
1460 $fname = __METHOD__
1461 );
1462
1475 public function delete( $table, $conds, $fname = __METHOD__ );
1476
1507 public function insertSelect(
1508 $destTable,
1509 $srcTable,
1510 $varMap,
1511 $conds,
1512 $fname = __METHOD__,
1513 $insertOptions = [],
1514 $selectOptions = [],
1515 $selectJoinConds = []
1516 );
1517
1524
1534 public function unionQueries( $sqls, $all );
1535
1563 $table,
1564 $vars,
1565 array $permute_conds,
1566 $extra_conds = '',
1567 $fname = __METHOD__,
1568 $options = [],
1569 $join_conds = []
1570 );
1571
1582 public function conditional( $cond, $caseTrueExpression, $caseFalseExpression );
1583
1592 public function strreplace( $orig, $old, $new );
1593
1600 public function getServerUptime();
1601
1609 public function wasDeadlock();
1610
1618 public function wasLockTimeout();
1619
1628 public function wasConnectionLoss();
1629
1635 public function wasReadOnlyError();
1636
1644 public function wasErrorReissuable();
1645
1661 public function primaryPosWait( DBPrimaryPos $pos, $timeout );
1662
1672 public function masterPosWait( DBPrimaryPos $pos, $timeout );
1673
1680 public function getReplicaPos();
1681
1689 public function getPrimaryPos();
1690
1696 public function getMasterPos();
1697
1703 public function serverIsReadOnly();
1704
1737 public function onTransactionResolution( callable $callback, $fname = __METHOD__ );
1738
1773 public function onTransactionCommitOrIdle( callable $callback, $fname = __METHOD__ );
1774
1783 public function onTransactionIdle( callable $callback, $fname = __METHOD__ );
1784
1814 public function onTransactionPreCommitOrIdle( callable $callback, $fname = __METHOD__ );
1815
1839 public function onAtomicSectionCancel( callable $callback, $fname = __METHOD__ );
1840
1858 public function setTransactionListener( $name, callable $callback = null );
1859
1934 public function startAtomic( $fname = __METHOD__, $cancelable = self::ATOMIC_NOT_CANCELABLE );
1935
1947 public function endAtomic( $fname = __METHOD__ );
1948
1974 public function cancelAtomic( $fname = __METHOD__, AtomicSectionIdentifier $sectionId = null );
1975
2048 public function doAtomicSection(
2049 $fname, callable $callback, $cancelable = self::ATOMIC_NOT_CANCELABLE
2050 );
2051
2071 public function begin( $fname = __METHOD__, $mode = self::TRANSACTION_EXPLICIT );
2072
2091 public function commit( $fname = __METHOD__, $flush = self::FLUSHING_ONE );
2092
2112 public function rollback( $fname = __METHOD__, $flush = self::FLUSHING_ONE );
2113
2133 public function flushSnapshot( $fname = __METHOD__, $flush = self::FLUSHING_ONE );
2134
2146 public function timestamp( $ts = 0 );
2147
2162 public function timestampOrNull( $ts = null );
2163
2170 public function ping( &$rtt = null );
2171
2180 public function getLag();
2181
2196 public function getSessionLagStatus();
2197
2203 public function maxListLen();
2204
2215 public function encodeBlob( $b );
2216
2226 public function decodeBlob( $b );
2227
2239 public function setSessionOptions( array $options );
2240
2248 public function setSchemaVars( $vars );
2249
2259 public function lockIsFree( $lockName, $method );
2260
2273 public function lock( $lockName, $method, $timeout = 5, $flags = 0 );
2274
2285 public function unlock( $lockName, $method );
2286
2308 public function getScopedLockAndFlush( $lockKey, $fname, $timeout );
2309
2316 public function namedLocksEnqueue();
2317
2325 public function getInfinity();
2326
2333 public function encodeExpiry( $expiry );
2334
2342 public function decodeExpiry( $expiry, $format = TS_MW );
2343
2353 public function setBigSelects( $value = true );
2354
2359 public function isReadOnly();
2360
2374 public function setTableAliases( array $aliases );
2375
2388 public function setIndexAliases( array $aliases );
2389
2397 public function __toString();
2398}
2399
2403class_alias( IDatabase::class, 'IDatabase' );
const LIST_NAMES
Definition Defines.php:45
const LIST_COMMA
Definition Defines.php:42
const LIST_SET
Definition Defines.php:44
const LIST_OR
Definition Defines.php:46
const LIST_AND
Definition Defines.php:43
Class used for token representing identifiers for atomic sections from IDatabase instances.
An object representing a primary or replica DB position in a replicated setup.
Basic database interface for live and lazy-loaded relation database handles.
Definition IDatabase.php:38
onTransactionResolution(callable $callback, $fname=__METHOD__)
Run a callback when the current transaction commits or rolls back.
onTransactionPreCommitOrIdle(callable $callback, $fname=__METHOD__)
Run a callback before the current transaction commits or now if there is none.
flushSnapshot( $fname=__METHOD__, $flush=self::FLUSHING_ONE)
Commit any transaction but error out if writes or callbacks are pending.
rollback( $fname=__METHOD__, $flush=self::FLUSHING_ONE)
Rollback a transaction previously started using begin()
setSessionOptions(array $options)
Override database's default behavior.
buildGroupConcatField( $delim, $table, $field, $conds='', $join_conds=[])
Build a GROUP_CONCAT or equivalent statement for a query.
nextSequenceValue( $seqName)
Deprecated method, calls should be removed.
lastDoneWrites()
Get the last time the connection may have been used for a write query.
unlock( $lockName, $method)
Release a lock.
namedLocksEnqueue()
Check to see if a named lock used by lock() use blocking queues.
setBigSelects( $value=true)
Allow or deny "big selects" for this session only.
makeList(array $a, $mode=self::LIST_COMMA)
Makes an encoded list of strings from an array.
buildLike( $param,... $params)
LIKE statement wrapper.
selectRow( $table, $vars, $conds, $fname=__METHOD__, $options=[], $join_conds=[])
Wrapper to IDatabase::select() that only fetches one row (via LIMIT)
addIdentifierQuotes( $s)
Escape a SQL identifier (e.g.
dataSeek(IResultWrapper $res, $row)
Change the position of the cursor in a result object.
primaryPosWait(DBPrimaryPos $pos, $timeout)
Wait for the replica DB to catch up to a given primary DB position.
wasLockTimeout()
Determines if the last failure was due to a lock timeout.
doAtomicSection( $fname, callable $callback, $cancelable=self::ATOMIC_NOT_CANCELABLE)
Perform an atomic section of reversable SQL statements from a callback.
limitResult( $sql, $limit, $offset=false)
Construct a LIMIT query with optional offset.
selectSQLText( $table, $vars, $conds='', $fname=__METHOD__, $options=[], $join_conds=[])
Take the same arguments as IDatabase::select() and return the SQL it would use.
bitAnd( $fieldLeft, $fieldRight)
fetchObject(IResultWrapper $res)
Fetch the next row from the given result object, in object form.
getDomainID()
Return the currently selected domain ID.
lastErrno()
Get the last error number.
aggregateValue( $valuedata, $valuename='value')
Return aggregated value alias.
assertNoOpenTransactions()
Assert that all explicit transactions or atomic sections have been closed.
endAtomic( $fname=__METHOD__)
Ends an atomic section of SQL statements.
lock( $lockName, $method, $timeout=5, $flags=0)
Acquire a named lock.
getServer()
Get the hostname or IP address of the server.
select( $table, $vars, $conds='', $fname=__METHOD__, $options=[], $join_conds=[])
Execute a SELECT query constructed using the various parameters provided.
decodeExpiry( $expiry, $format=TS_MW)
Decode an expiry time into a DBMS independent format.
selectDB( $db)
Change the current database.
getReplicaPos()
Get the replication position of this replica DB.
setSchemaVars( $vars)
Set schema variables to be used when streaming commands from SQL files or stdin.
tableExists( $table, $fname=__METHOD__)
Query whether a given table exists.
setLBInfo( $nameOrArray, $value=null)
Set the entire array or a particular key of the managing load balancer info array.
setTransactionListener( $name, callable $callback=null)
Run a callback after each time any transaction commits or rolls back.
getSoftwareLink()
Returns a wikitext style link to the DB's website (e.g.
masterPosWait(DBPrimaryPos $pos, $timeout)
wasErrorReissuable()
Determines if the last query error was due to something outside of the query itself.
lockForUpdate( $table, $conds='', $fname=__METHOD__, $options=[], $join_conds=[])
Lock all rows meeting the given conditions/options FOR UPDATE.
setIndexAliases(array $aliases)
Convert certain index names to alternative names before querying the DB.
getLBInfo( $name=null)
Get properties passed down from the server info array of the load balancer.
__toString()
Get a debugging string that mentions the database type, the ID of this instance, and the ID of any un...
restoreFlags( $state=self::RESTORE_PRIOR)
Restore the flags to their prior state before the last setFlag/clearFlag call.
insertSelect( $destTable, $srcTable, $varMap, $conds, $fname=__METHOD__, $insertOptions=[], $selectOptions=[], $selectJoinConds=[])
INSERT SELECT wrapper.
buildSubString( $input, $startPosition, $length=null)
Build a SUBSTRING function.
numFields(IResultWrapper $res)
Get the number of fields in a result object.
deleteJoin( $delTable, $joinTable, $delVar, $joinVar, $conds, $fname=__METHOD__)
DELETE where the condition is a join.
wasConnectionLoss()
Determines if the last query error was due to a dropped connection.
getTopologyBasedServerId()
Get a non-recycled ID that uniquely identifies this server within the replication topology.
getInfinity()
Find out when 'infinity' is.
freeResult(IResultWrapper $res)
Free a result object returned by query() or select()
affectedRows()
Get the number of rows affected by the last write query.
getServerUptime()
Determines how long the server has been up.
indexExists( $table, $index, $fname=__METHOD__)
Determines whether an index exists.
getServerInfo()
Get a human-readable string describing the current software version.
fieldName(IResultWrapper $res, $n)
Get a field name in a result object.
makeWhereFrom2d( $data, $baseKey, $subKey)
Build a partial where clause from a 2-d array such as used for LinkBatch.
implicitOrderby()
Returns true if this database does an implicit order by when the column has an index For example: SEL...
anyChar()
Returns a token for buildLike() that denotes a '_' to be used in a LIKE query.
getFlag( $flag)
Returns a boolean whether the flag $flag is set for this connection.
lockIsFree( $lockName, $method)
Check to see if a named lock is not locked by any thread (non-blocking)
buildConcat( $stringList)
Build a concatenation list to feed into a SQL query.
clearFlag( $flag, $remember=self::REMEMBER_NOTHING)
Clear a flag for this connection.
pendingWriteRowsAffected()
Get the number of affected rows from pending write queries.
pendingWriteQueryDuration( $type=self::ESTIMATE_TOTAL)
Get the time spend running write queries for this transaction.
lastQuery()
Get the last query that sent on account of IDatabase::query()
anyString()
Returns a token for buildLike() that denotes a '' to be used in a LIKE query.
update( $table, $set, $conds, $fname=__METHOD__, $options=[])
Update all rows in a table that match a given condition.
addQuotes( $s)
Escape and quote a raw value string for use in a SQL query.
buildSelectSubquery( $table, $vars, $conds='', $fname=__METHOD__, $options=[], $join_conds=[])
Equivalent to IDatabase::selectSQLText() except wraps the result in Subquery.
timestamp( $ts=0)
Convert a timestamp in one of the formats accepted by ConvertibleTimestamp to the format used for ins...
selectDomain( $domain)
Set the current domain (database, schema, and table prefix)
upsert( $table, array $rows, $uniqueKeys, array $set, $fname=__METHOD__)
Upsert the given row(s) into a table.
fetchRow(IResultWrapper $res)
Fetch the next row from the given result object, in associative array form.
lastError()
Get a description of the last error.
maxListLen()
Return the maximum number of items allowed in a list, or 0 for unlimited.
selectField( $table, $var, $cond='', $fname=__METHOD__, $options=[], $join_conds=[])
A SELECT wrapper which returns a single field from a single result row.
commit( $fname=__METHOD__, $flush=self::FLUSHING_ONE)
Commits a transaction previously started using begin()
getTopologyRole()
Get the replication topology role of this server.
getType()
Get the RDBMS type of the server (e.g.
getLag()
Get the amount of replication lag for this database server.
getSessionLagStatus()
Get the replica DB lag when the current transaction started or a general lag estimate if not transact...
unionSupportsOrderAndLimit()
Determine if the RDBMS supports ORDER BY and LIMIT for separate subqueries within UNION.
bitOr( $fieldLeft, $fieldRight)
onTransactionCommitOrIdle(callable $callback, $fname=__METHOD__)
Run a callback when the current transaction commits or now if there is none.
newSelectQueryBuilder()
Create an empty SelectQueryBuilder which can be used to run queries against this connection.
wasDeadlock()
Determines if the last failure was due to a deadlock.
conditional( $cond, $caseTrueExpression, $caseFalseExpression)
Returns an SQL expression for a simple conditional.
encodeExpiry( $expiry)
Encode an expiry time into the DBMS dependent format.
tablePrefix( $prefix=null)
Get/set the table prefix.
selectRowCount( $tables, $var=' *', $conds='', $fname=__METHOD__, $options=[], $join_conds=[])
Get the number of rows in dataset.
setTableAliases(array $aliases)
Make certain table names use their own database, schema, and table prefix when passed into SQL querie...
databasesAreIndependent()
Returns true if DBs are assumed to be on potentially different servers.
numRows( $res)
Get the number of rows in a query result.
ping(&$rtt=null)
Ping the server and try to reconnect if it there is no connection.
getTopologyRootPrimary()
Get the readable name of the sole root primary DB server for the replication topology.
getScopedLockAndFlush( $lockKey, $fname, $timeout)
Acquire a named lock, flush any transaction, and return an RAII style unlocker object.
decodeBlob( $b)
Some DBMSs return a special placeholder object representing blob fields in result objects.
onAtomicSectionCancel(callable $callback, $fname=__METHOD__)
Run a callback when the atomic section is cancelled.
fieldExists( $table, $field, $fname=__METHOD__)
Determines whether a field exists in a table.
query( $sql, $fname=__METHOD__, $flags=0)
Run an SQL query and return the result.
buildGreatest( $fields, $values)
Build a GREATEST function statement comparing columns/values.
encodeBlob( $b)
Some DBMSs have a special format for inserting into blob fields, they don't allow simple quoted strin...
getServerVersion()
A string describing the current software version, like from mysql_get_server_info()
begin( $fname=__METHOD__, $mode=self::TRANSACTION_EXPLICIT)
Begin a transaction.
insert( $table, $rows, $fname=__METHOD__, $options=[])
Insert the given row(s) into a table.
replace( $table, $uniqueKeys, $rows, $fname=__METHOD__)
Insert row(s) into a table, deleting all conflicting rows beforehand.
close( $fname=__METHOD__, $owner=null)
Close the database connection.
buildLeast( $fields, $values)
Build a LEAST function statement comparing columns/values.
selectFieldValues( $table, $var, $cond='', $fname=__METHOD__, $options=[], $join_conds=[])
A SELECT wrapper which returns a list of single field values from result rows.
wasReadOnlyError()
Determines if the last failure was due to the database being read-only.
trxLevel()
Gets the current transaction level.
startAtomic( $fname=__METHOD__, $cancelable=self::ATOMIC_NOT_CANCELABLE)
Begin an atomic section of SQL statements.
unionConditionPermutations( $table, $vars, array $permute_conds, $extra_conds='', $fname=__METHOD__, $options=[], $join_conds=[])
Construct a UNION query for permutations of conditions.
insertId()
Get the inserted value of an auto-increment row.
strreplace( $orig, $old, $new)
Returns a SQL expression for simple string replacement (e.g.
setFlag( $flag, $remember=self::REMEMBER_NOTHING)
Set a flag for this connection.
trxTimestamp()
Get the UNIX timestamp of the time that the transaction was established.
getDBname()
Get the current database name; null if there isn't one.
writesOrCallbacksPending()
Whether there is a transaction open with either possible write queries or unresolved pre-commit/commi...
getServerName()
Get the readable name for the server.
const LOCK_TIMESTAMP
Flag to return the lock acquision timestamp (null if not acquired)
pendingWriteCallers()
Get the list of method names that did write queries for this transaction.
getPrimaryPos()
Get the position of this primary DB.
cancelAtomic( $fname=__METHOD__, AtomicSectionIdentifier $sectionId=null)
Cancel an atomic section of SQL statements.
unionQueries( $sqls, $all)
Construct a UNION query.
dbSchema( $schema=null)
Get/set the db schema.
timestampOrNull( $ts=null)
Convert a timestamp in one of the formats accepted by ConvertibleTimestamp to the format used for ins...
estimateRowCount( $tables, $var=' *', $conds='', $fname=__METHOD__, $options=[], $join_conds=[])
Estimate the number of rows in dataset.
onTransactionIdle(callable $callback, $fname=__METHOD__)
Alias for onTransactionCommitOrIdle() for backwards-compatibility.
Result wrapper for grabbing data queried from an IDatabase object.
foreach( $mmfl['setupFiles'] as $fileName) if($queue) if(empty( $mmfl['quiet'])) $s
const DBO_NOBUFFER
Definition defines.php:10
const DBO_DDLMODE
Definition defines.php:16
const DBO_SYSDBA
Definition defines.php:15
const DBO_COMPRESS
Definition defines.php:18
const DBO_DEFAULT
Definition defines.php:13
const DBO_SSL
Definition defines.php:17
const DBO_IGNORE
Definition defines.php:11
const DBO_PERSISTENT
Definition defines.php:14
const DBO_DEBUG
Definition defines.php:9
const DBO_TRX
Definition defines.php:12