Performs a DELETE statement on the model's table in the master database.

        :param where: The WHERE clause. This can be a plain string, a dict or an array.
        :type where: string, dict, array
356211
def delete(self, **kwargs):
        
        kwargs['stack'] = self.stack_mark(inspect.stack())
        
        return self.db_adapter(role='master').delete(**kwargs)
507387
async def remove(self, *instances, using_db=None) -> None:
        
        db = using_db if using_db else self.model._meta.db
        if not instances:
            raise OperationalError("remove() called on no instances")
        through_table = Table(self.field.through)

        if len(instances) == 1:
            condition = (getattr(through_table, self.field.forward_key) == instances[0].id) & (
                getattr(through_table, self.field.backward_key) == self.instance.id
            )
        else:
            condition = (getattr(through_table, self.field.backward_key) == self.instance.id) & (
                getattr(through_table, self.field.forward_key).isin([i.id for i in instances])
            )
        query = db.query_class.from_(through_table).where(condition).delete()
        await db.execute_query(str(query))
174373
protected function _delete($where)
    {
        $params = array();
        $query = "DELETE FROM $this->_name";

        $iWhere = 0;
        $query .= " WHERE (";
        foreach ($where as $key => $value) {
            if (!is_int($key)) {
                $query .= "$key = :where$iWhere AND ";
                $params[":where$iWhere"] = $value;
                $iWhere++;
            } else {
                $query .= "$value AND";
            }
        }
        $query = substr($query, 0, -4);
        $query .= ")";

        $db = $this->db;
        $sth = $db->prepare($query);

        foreach ($params as $key => $val) {
            if (is_int($val)) {
                $sth->bindValue("$key", $val, $db::PARAM_INT);
            } else {
                $sth->bindValue("$key", $val);
            }
        }

        $response = $sth->execute();

        if ($response) {

            return true;
        }

        return false;
    }
1111738
def query_delete(cls, expression=None):
        
        if expression is not None:
            executor = Executor(cls.__database__)
            result = executor.execute(expression)
        else:
            result = cls._query.all_index()

        for hash_id in result:
            cls.load(hash_id, convert_key=False).delete()
401098
def delete(self, model, commit=True):
        
        self.is_instance(model)
        db.session.delete(model)
        if commit:
            db.session.commit()

        return model
14119
def _set_where(self):
        
        foreign = self.get_foreign_key()

        self._query.where(foreign, "=", self._parent.get_key())

        return self
189734
def delete(self):
        
        cmd = "delete from {table} {where_clause}".format(
            table=self.table_name,
            where_clause=self.where_clause
        ).rstrip()
        Repo.db.execute(cmd, self.where_values)
147607
def delete(sql_params = "", *bindvars)
      delete_sql = "DELETE FROM \"#{@schema_name}\".\"#{@table_name}\" "
      case sql_params
      when String
        delete_sql << sql_params
      when Hash
        raise ArgumentError, "Cannot specify bind variables when passing WHERE conditions as Hash" unless bindvars.empty?
        where_sqls = []
        sql_params.each do |k, v|
          where_sqls << "#{k} = :#{k}"
          bindvars << v
        end
        delete_sql << "WHERE " << where_sqls.join(" AND ") unless where_sqls.empty?
      else
        raise ArgumentError, "Only String or Hash can be provided as SQL condition argument"
      end
      @schema.execute(delete_sql, *bindvars)
    end
1340386
def _compile_update_wheres(self, query):
        
        base_where = self._compile_wheres(query)

        if not query.joins:
            return base_where

        join_where = self._compile_update_join_wheres(query)

        if not base_where.strip():
            return "WHERE %s" % self._remove_leading_boolean(join_where)

        return "%s %s" % (base_where, join_where)
120952
def result(self, *args, **kwargs):
        
        prettify = kwargs.get('pretty', False)

        sql = 'DELETE %s %s' % (self._type, self._class)
        
        if prettify:
            sql += '\n'
        else:
            sql += ' '

        if self.where_criteria.size() > 0:
            sql +=  'WHERE '
            sql +=  self.where_criteria.result()
            if prettify:
                sql += '\n'
            else:
                sql += ' '
        
        return sql
273577
function delete( $table, $where = array(), $params = array() ) {

        if ( !is_array( $where ) ) $where = array( $where );
        if ( !is_array( $params ) ) $params = array_slice( func_get_args(), 2 );

        $table = $this->rewriteTable( $table );
        $query = "DELETE FROM " . $this->quoteIdentifier( $table );
        $query .= $this->getSuffix( $where );

        $this->onQuery( $query, $params );

        $statement = $this->prepare( $query );
        $statement->execute( $params );

        return $statement;

    }
1182239
def where(self, where: str) -> 'SASdata':
        
        sd = SASdata(self.sas, self.libref, self.table, dsopts=dict(self.dsopts))
        sd.HTML = self.HTML
        sd.dsopts['where'] = where
        return sd
263487
def where(self, key, operator, value):
        
        self.__store_query({"key": key, "operator": operator, "value": value})
        return self
854053
public function delete($where, $session)
    {

        $database = $this->database;

        if (isset($where["session_key"])) {
            $where["session_key"] = $database->quote($where["session_key"]);
        }
        $database->delete($session->table, $where);

        return true;
    }
21644
public function delete(array $where)
    {
        // Current table
        $table = $this->getCollection();

        // Generate where line
        $whereDetails = !empty($where)
            ? ' WHERE ' . $this->genWhere($where)
            : '';

        // Prepare query
        $statement = $this->getInstance()->prepare("DELETE FROM $table $whereDetails");

        // Bind where values
        foreach ($where as $key => $value) {
            $statement->bindValue(":where_$key", $value, $this->isPdoInt($value));
        }

        // Execute operation
        $statement->execute();

        // Return count of affected rows
        return $statement->rowCount();
    }
981954
public function delete($where, $table = null)
    {
        if (is_array($where)) {
            $pk = $where[$this->getPrimaryKey()];
        } else {
            $pk = (int)$where;
        }

        $row = $this->getPosition($pk);

        $where = new Where;
        $where->between(self::COLUMN_LEFT, $row->getLft(), $row->getRgt());

        $result = parent::delete($where, $table);

        if ($result) {
            $this->updateTree($row->getRgt(), '-', $row->width());
        }

        return $result;
    }
679051
def delete(self):
        ''' 
        '''
        SQL = 'DELETE FROM %s' % self._table
        if self._selectors:
            SQL = ' '.join([SQL, 'WHERE', self._selectors]).strip()
        
        return SQL