Run a delete statement
@param  string $from
@param  array|string $wheres
@param  array $options
@return int|array
@throws \RuntimeException
778319
public function delete(string $from, $wheres, array $options = [])
    {
        if (!$wheres) {
            throw new \RuntimeException('Safety considerations, where conditions can not be empty');
        }

        list($where, $bindings) = $this->handleWheres($wheres);

        $options['from'] = $this->qn($from);
        $options['where'] = $where;

        $statement = $this->compileDelete($options);

        if (isset($options['dumpSql'])) {
            return [$statement, $bindings];
        }

        return $this->fetchAffected($statement, $bindings);
    }
1307963
public function findDeleted($query, $options)
    {
        $query->where([
            $this->config('field') => $this->config('states.deleted'),
        ]);

        return $query;
    }
62410
public static function delete($sub_app_id, $options = null)
    {
        $url = static::instanceUrlWithId($sub_app_id);
        return static::_directRequest('delete', $url, null, $options);
    }
697606
public function delete(array $options = [])
    {
        return $this->connection->deleteSession($options + [
            'name' => $this->name(),
            'database' => $this->database
        ]);
    }
1106813
public function delete($table, $where = [], array $bind = [])
    {
        $table = $this->quote()->identifier($table);
        $sql   = "DELETE FROM $table";
        if (is_array($where)) {
            $where = $this->createWhereExpression($where);
        }
        $sql .= (($where) ? " WHERE {$where}" : '');

        $stmt = $this->query($sql, $bind);

        return $stmt->rowCount();
    }
1311062
public function delete($table, $data, $keys, $options = []) {
		return $this->object->delete($table, $data, $keys, $options);
	}
981967
public function delete($table, $options = array())
    {
        $query_string = 'DELETE FROM `' . $this->pref . $table . '`' . $this->opt($options);

        try {
            $stmt = $this->doQuery($query_string);
            return $stmt->rowCount();
        } catch (\Exception $e) {
            print_r($e->getMessage());
            return false;
        }
    }
541509
public function findBy(array $wheres, array $options = [])
    {
        $query = $this->getSqlObject()->select();

        $this->setColumns($query, $options);

        $wheres = $this->addJoins($query, $wheres, $options);

        $this->addWheres($query, $wheres, $options);

        if (Arr::get($options, 'order')) {
            $this->setOrder($query, $options['order']);
        }

        return $this->executeAndGetResultsAsEntity($query);
    }
10235
protected function platformPrepareSqlStatement($sqlStatement, array $options = [])
    {
        // Sqlite3::changes() returns 0 for "DELETE FROM TABLE" queries. This hack
        // modifies the query so that it a proper number of affected rows is returned.
        if ($this->isDeleteHack === true && preg_match('/^\s*DELETE\s+FROM\s+(\S+)\s*$/i', $sqlStatement)) {
            return trim($sqlStatement) . ' WHERE 1=1';
        }

        return $sqlStatement;
    }
194950
function delete(array $where, $returning = null) {
		$query = $this->getQueryWriter()->reset();
		$query->write("DELETE FROM", $this->conn->quoteName($this->name));
		$query->write("WHERE")->criteria($where);
		if (strlen($returning)) {
			$query->write("RETURNING", $returning);
		}
		return $this->execute($query);
	}
640701
public function sqlDelete(
		$from,
		$where,
		array $where_params,
		$limit = null
	) {
		$sql = $this->queryBuilder->buildDelete($from, $where, $limit);
		$query = $this->database->prepare($sql);
		$query->execute($where_params);
		$this->addQuery($query->queryString, $where_params);
		return $query->rowCount();
	}
723968
public function deleteWhere($where, array $values = [])
    {
        if (!$where instanceof Where) {
            $where = new Where($where, $values);
        }

        $sql = strtr(
            "delete from :relation where :condition returning :projection",
            [
                ':relation'   => $this->getStructure()->getRelation(),
                ':condition'  => (string) $where,
                ':projection' => $this->createProjection()->formatFieldsWithFieldAlias(),
            ]
        );

        $collection = $this->query($sql, $where->getValues());
        foreach ($collection as $entity) {
            $entity->status(FlexibleEntityInterface::STATUS_NONE);
        }
        $collection->rewind();

        return $collection;
    }
141557
public function delete($table, $where = '')
    {
        $where = $this->_whereExpr($where);

        /**
         * Build the DELETE statement
         */
        $sql = "DELETE FROM "
             . $this->quoteIdentifier($table, true)
             . (($where) ? " WHERE $where" : '');

        /**
         * Execute the statement and return the number of affected rows
         */
        $stmt = $this->query($sql);
        $result = $stmt->rowCount();
        return $result;
    }
546223
public static function delete(array $where): int
    {
        $self = static::getInstance();

        if (!\count($where)) {
            throw new DbException(
                "Method `Table::delete()` can't delete all records in the table `{$self->name}`,\n" .
                "please use `Db::query()` instead (of cause if you know what are you doing)"
            );
        }


        $where = static::filterColumns($where);

        if (!\count($where)) {
            throw new DbException(
                "Invalid field names of table `{$self->name}`. Please check use of `delete()` method"
            );
        }

        $table = DbProxy::quoteIdentifier($self->name);

        $sql = "DELETE FROM $table WHERE " . implode(' AND ', self::prepareStatement($where));
        return DbProxy::query($sql, array_values($where));
    }
354423
final public function delete($table, $where=[]) {
		$stmt = "DELETE FROM $table";
		if ($where) {
			$pair_wheres = [];
			$params = [];
			foreach ($where as $key => $val) {
				$pair_wheres[] = "{$key}=?";
				$params[] = $val;
			}
			$stmt .= " WHERE " . implode(" AND ", $pair_wheres);
		}

		self::$logger->info(sprintf(
			"SQL: delete ok: %s <- '%s'.",
			$stmt, json_encode($where)));

		$this->prepare_statement($stmt, $params);
	}
161395
public function deleteByQuery($options = [])
    {
        if (!isset($this->queryParts['query'])) {
            throw new InvalidCallException('Can not call deleteByQuery when no query is given.');
        }
        $query = [
            'query' => $this->queryParts['query'],
        ];
        if (isset($this->queryParts['filter'])) {
            $query['filter'] = $this->queryParts['filter'];
        }
        $query = Json::encode($query);
        $url = [$this->index !== null ? $this->index : '_all'];
        if ($this->type !== null) {
            $url[] = $this->type;
        }
        $url[] = '_query';

        return $this->db->delete($url, array_merge($this->options, $options), $query);
    }
1255866
public function delete($options)
    {
        $where = $this->parseWhere($options['where']);
        $bulk = new BulkWrite;
        if (1 == $options['limit']) {
            $deleteOptions = ['limit' => 1];
        } else {
            $deleteOptions = ['limit' => 0];
        }
        $bulk->delete($where, $deleteOptions);
        $this->log('remove', $where, $deleteOptions);
        return $bulk;
    }