Creates a new UpdateQueryBuilder instance.

@param string $connectionName
@throws DatabaseException
@return DeleteQueryBuilder
199119
public function makeDelete(string $connectionName = ''): DeleteQueryBuilder
    {
        $connection = $this->provideConnection($connectionName);
        $statementBuilder = new DeleteStatementBuilder;
        return new DeleteQueryBuilder($connection, $statementBuilder);
    }
796598
public function getDatabaseMetadata(string $databaseName): DatabaseMetadata
    {
        if (!array_key_exists($databaseName, $this->databaseMetadataList)) {
            throw new \RuntimeException('Server "' . $this->host . '" doesn\'t contain database "' . $databaseName . '"');
        }

        return $this->databaseMetadataList[$databaseName];
    }
788572
public function addQuery($query, $connectionName = 'default')
    {
        $queryData = [
            $query['time'] / 1000,
            $query['query'],
            $query['bindings']
        ];
        $this->queriesByConnection[$connectionName][] = $queryData;
        if (!isset($this->totalQueriesTimeByConnection[$connectionName])) {
            $this->totalQueriesTimeByConnection[$connectionName] = 0;
        }
        $this->totalQueriesTimeByConnection[$connectionName] += $query['time'] / 1000;
        return $this;
    }
883979
public function query($query = null)
    {
        /** @var StmtInterface $result */
        try {
            
            $event = new ConnectionEvent($this, $query);
            $this->container->getDispatcher()->dispatch(ConnectionEvent::ON_QUERY, $event);
            
            $result = parent::query($query);
        } catch (\Exception $exception) {
            throw new ConnectionException(sprintf(
                'Executing SQL Query was failure with error: [%d] (%s)', $exception->getCode(), $exception->getMessage()));
        }
        
        return $result;
    }
34140
public function setDatabaseName($databaseName = "")
    {
        if (empty($databaseName)) {
            throw new GdgCommonsInvalidArgumentException("Database name must not be null or empty");
        }
        
        if (!is_string($databaseName)) {
            throw new GdgCommonsInvalidArgumentException("Database name must be string");
        }
        
        $this->_databaseName = $databaseName;
    }
732554
public function queue(Message $message, string $connectionName = null): MessageEnvelope
    {
        if (!$this->handles($message)) {
            throw new LogicException('Message of type ' . get_class($message) . " couldn't be handled by this notifier");
        }

        return $this->addToQueue($message, $connectionName);
    }
824981
public function runQuery($queryString){

		$cmd = strtoupper(substr(trim($queryString), 0, 6));
		static $list = array('UPDATE' => 1, 'DELETE' => 1, 'INSERT' => 1, 'REPLAC' => 1);
		$this->affectedRows = false;

		if(isset($list[$cmd])){
			$this->affectedRows = $this->resource->exec($queryString);

			if($this->affectedRows === false){
				$error = $this->resource->errorInfo();
				throw new DriverException("SQLSTATE[$error[0]]: $error[2]", $error[1], $queryString);
			} else
				return true;
		}

		$result = $this->resource->query($queryString);

		if($result === false){
			$error = $this->resource->errorInfo();
			throw new DriverException("SQLSTATE[$error[0]]: $error[2]", $error[1], $queryString);
		}else
			return $result;
	}
1222900
public function newFromBuilder($attributes = array(), $connection = null)
    {
        // hide ref_id from model, because ref_id == id
        $attributes = array_except((array) $attributes, $this->getVersionKeyName());

        return parent::newFromBuilder($attributes, $connection);
    }
371884
public static function createUpdate(Connection $connection, $table, $data){
		if(!($data instanceof Traversable || (is_array($data) && !empty($data))))
			throw new InvalidArgumentException('Argument 3 must be a non-empty array or Traversable.');

		$obj = new self($connection);
		$obj->type = Manager::STMT_UPDATE;
		$obj->source = $table;
		$obj->values = $data instanceof Traversable ? iterator_to_array($data) : $data;
		return $obj;
	}
868089
public function doDeleteAll(ConnectionInterface $con = null)
    {
        if (null === $con) {
            $con = Propel::getServiceContainer()->getWriteConnection(DealerContactVersionTableMap::DATABASE_NAME);
        }
        $affectedRows = 0; // initialize var to track total num of affected rows
        try {
            // use transaction because $criteria could contain info
            // for more than one table or we could emulating ON DELETE CASCADE, etc.
            $con->beginTransaction();
            $affectedRows += parent::doDeleteAll($con);
            // Because this db requires some delete cascade/set null emulation, we have to
            // clear the cached instance *after* the emulation has happened (since
            // instances get re-added by the select statement contained therein).
            DealerContactVersionTableMap::clearInstancePool();
            DealerContactVersionTableMap::clearRelatedInstancePool();

            $con->commit();
        } catch (PropelException $e) {
            $con->rollBack();
            throw $e;
        }

        return $affectedRows;
    }
947702
public function deleteEntry($dn)
    {
        if (! (@ldap_delete($this->connection, $dn))) {
            $code = @ldap_errno($this->connection);
            throw new PersistenceException(
                sprintf(
                    'Could not delete entry %s: Ldap Error Code=%s - %s',
                    $dn,
                    $code,
                    ldap_err2str($code)
                )
            );
        }
    }
529643
private function buildBaseQuery(
        Connection $connection,
        TableMetadata $tableMetadata,
        string $searchTerm
    ): QueryBuilder {

        // Build query except WHERE clause
        $queryBuilder = $connection
            ->createQueryBuilder()
            ->select('COUNT(*) AS count')
            ->from('`' . $tableMetadata->getDatabaseName() . '`.`' . $tableMetadata->getTableName() . '`')
            ->setParameter('search_term', '%' . $searchTerm . '%');

        foreach ($this->getSearchableColumnNames($tableMetadata) as $index => $columnName) {
            $clause = '`' . $columnName . '` LIKE :search_term';
            if (0 === $index) {
                $queryBuilder->where($clause);
            } else {
                $queryBuilder->orWhere($clause);
            }
        }

        return $queryBuilder;
    }
1299367
public function create(array $data, $databaseConnectionName = null)
  {
    if(empty($databaseConnectionName))
    {
      $databaseConnectionName = $this->databaseConnectionName;
    }

    $ApportionmentEntry = new ApportionmentEntry();
    $ApportionmentEntry->setConnection($databaseConnectionName);
    $ApportionmentEntry->fill($data)->save();

    return $ApportionmentEntry;
  }
1134752
public function createDatabase($connectionName)
    {
        $configuration = $this->getConfiguration($connectionName);
        $database = $this->getConnection($connectionName);

        $database->DBCreate(
            $configuration->getDatabase(),
            $configuration->getDataType(),
            $configuration->getStorageType()
        );

        return $this->getDatabase($connectionName);
    }
528629
public function connect(array $params, $username = null, $password = null, array $driverOptions = [])
    {
        try {
            return new SQLAnywhereConnection(
                $this->buildDsn(
                    $params['host'] ?? null,
                    $params['port'] ?? null,
                    $params['server'] ?? null,
                    $params['dbname'] ?? null,
                    $username,
                    $password,
                    $driverOptions
                ),
                $params['persistent'] ?? false
            );
        } catch (SQLAnywhereException $e) {
            throw DBALException::driverException($this, $e);
        }
    }
56897
private function createDeletedRevisionsQueryBuilder(Connection $connection, QueryBuilder $parentQueryBuilder)
    {
        $tableName = $this->configuration->getTableName($this->metadata);
        $revisionFieldName = $this->configuration->getRevisionFieldName();
        $identifierColumnNames = $this->metadata->getIdentifierColumnNames();

        $queryBuilder = $connection->createQueryBuilder()
            ->select('1')
            ->from($tableName, 'sd')
            ->andWhere(sprintf('sd.%1$s > t.%1$s', $revisionFieldName));

        $queryBuilder->andWhere(sprintf(
            'sd.%s <= %s',
            $revisionFieldName,
            $parentQueryBuilder->createPositionalParameter($this->revision)
        ));
        $queryBuilder->andWhere(sprintf(
            'sd.%s = %s',
            $this->configuration->getRevisionTypeFieldName(),
            $parentQueryBuilder->createPositionalParameter('DEL')
        ));

        //ids
        foreach ($identifierColumnNames as $name) {
            $queryBuilder->andWhere(sprintf('sd.%1$s = t.%1$s', $name));
        }

        return $queryBuilder;
    }
816729
public static function getInstance($connectName)
    {
        static $db = null;
        if(!$db){
            $db = new Connection($connectName);
        }
        return $db->dbConnection;
    }