23use InvalidArgumentException;
25use Wikimedia\ScopedCallback;
40 public const TRIGGER_IDLE = 1;
42 public const TRIGGER_COMMIT = 2;
44 public const TRIGGER_ROLLBACK = 3;
46 public const TRIGGER_CANCEL = 4;
49 public const TRANSACTION_EXPLICIT =
'';
51 public const TRANSACTION_INTERNAL =
'implicit';
54 public const ATOMIC_NOT_CANCELABLE =
'';
56 public const ATOMIC_CANCELABLE =
'cancelable';
59 public const FLUSHING_ONE =
'';
61 public const FLUSHING_ALL_PEERS =
'flush';
63 public const FLUSHING_INTERNAL =
'flush-internal';
66 public const REMEMBER_NOTHING =
'';
68 public const REMEMBER_PRIOR =
'remember';
70 public const RESTORE_PRIOR =
'prior';
72 public const RESTORE_INITIAL =
'initial';
75 public const ESTIMATE_TOTAL =
'total';
77 public const ESTIMATE_DB_APPLY =
'apply';
112 public const QUERY_NORMAL = 0;
114 public const QUERY_SILENCE_ERRORS = 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;
136 public const UNION_ALL =
true;
138 public const UNION_DISTINCT =
false;
141 public const LB_TRX_ROUND_ID =
'trxRoundId';
143 public const LB_READ_ONLY_REASON =
'readOnlyReason';
146 public const ROLE_STREAMING_MASTER =
'streaming-master';
148 public const ROLE_STREAMING_REPLICA =
'streaming-replica';
150 public const ROLE_STATIC_CLONE =
'static-clone';
152 public const ROLE_UNKNOWN =
'unknown';
155 public const ALL_ROWS =
'*';
251 public function setLBInfo( $nameOrArray, $value =
null );
336 public function setFlag( $flag, $remember = self::REMEMBER_NOTHING );
344 public function clearFlag( $flag, $remember = self::REMEMBER_NOTHING );
503 public function close( $fname = __METHOD__, $owner =
null );
532 public function query( $sql, $fname = __METHOD__, $flags = 0 );
568 $table, $var, $cond =
'', $fname = __METHOD__, $options = [], $join_conds = []
589 $table, $var, $cond =
'', $fname = __METHOD__, $options = [], $join_conds = []
841 $tables, $var =
'*', $conds =
'', $fname = __METHOD__, $options = [], $join_conds = []
863 $tables, $var =
'*', $conds =
'', $fname = __METHOD__, $options = [], $join_conds = []
879 $table, $conds =
'', $fname = __METHOD__, $options = [], $join_conds = []
891 public function fieldExists( $table, $field, $fname = __METHOD__ );
902 public function indexExists( $table, $index, $fname = __METHOD__ );
933 public function insert( $table, $rows, $fname = __METHOD__, $options = [] );
959 public function update( $table, $set, $conds, $fname = __METHOD__, $options = [] );
986 public function makeList( array $a, $mode = self::LIST_COMMA );
1028 public function bitAnd( $fieldLeft, $fieldRight );
1035 public function bitOr( $fieldLeft, $fieldRight );
1061 $delim, $table, $field, $conds =
'', $join_conds = []
1142 $fname = __METHOD__,
1318 public function replace( $table, $uniqueKeys, $rows, $fname = __METHOD__ );
1353 $table, array $rows, $uniqueKeys, array $set, $fname = __METHOD__
1397 public function delete( $table, $conds, $fname = __METHOD__ );
1434 $fname = __METHOD__,
1435 $insertOptions = [],
1436 $selectOptions = [],
1437 $selectJoinConds = []
1487 array $permute_conds,
1489 $fname = __METHOD__,
1825 public function startAtomic( $fname = __METHOD__, $cancelable = self::ATOMIC_NOT_CANCELABLE );
1940 $fname, callable $callback, $cancelable = self::ATOMIC_NOT_CANCELABLE
1962 public function begin( $fname = __METHOD__, $mode = self::TRANSACTION_EXPLICIT );
1982 public function commit( $fname = __METHOD__, $flush = self::FLUSHING_ONE );
2003 public function rollback( $fname = __METHOD__, $flush = self::FLUSHING_ONE );
2024 public function flushSnapshot( $fname = __METHOD__, $flush = self::FLUSHING_ONE );
2061 public function ping( &$rtt =
null );
2163 public function lock( $lockName, $method, $timeout = 5 );
2175 public function unlock( $lockName, $method );
2293class_alias( IDatabase::class,
'IDatabase' );