*/
use Wikimedia\Rdbms\LoadBalancer;
+use Wikimedia\Rdbms\IDatabase;
+use Wikimedia\Rdbms\DBConnRef;
+use Wikimedia\Rdbms\MaintainableDBConnRef;
/**
* DB accessable external objects.
public function store( $location, $data ) {
$dbw = $this->getMaster( $location );
- $id = $dbw->nextSequenceValue( 'blob_blob_id_seq' );
$dbw->insert( $this->getTable( $dbw ),
- [ 'blob_id' => $id, 'blob_text' => $data ],
+ [ 'blob_text' => $data ],
__METHOD__ );
$id = $dbw->insertId();
if ( !$id ) {
return "DB://$location/$id";
}
+ public function isReadOnly( $location ) {
+ return ( $this->getLoadBalancer( $location )->getReadOnlyReason() !== false );
+ }
+
/**
* Get a LoadBalancer for the specified cluster
*