Delete row by id query creation.

        :param int row_id: Identifier of the deleted row.
        :param ResourceQueryContext ctx: The context of this delete query.
435076
def _create_delete_one_query(self, row_id, ctx):
        

        assert isinstance(ctx, ResourceQueryContext)
        return self._orm.query(self.model_cls).filter(self._model_pk == row_id)
872045
public void deleteById(String id) {
    if (idToVersion.containsKey(id)) {
      String version = idToVersion.remove(id);
      expirationVersion.remove(version);
      versionToItem.remove(version);
      if (collectionCachePath != null
          && !collectionCachePath.resolve(version).toFile().delete()) {
        log.debug("couldn't delete " + version);
      }
    }
  }
1064215
def delete_record(self, record_id):
        
        self._delete(
            urljoin(self.base_url, "informationobjects/{}".format(record_id)),
            expected_response=204,
        )
        return {"status": "Deleted"}
211904
def delete(self, id: int):
        
        assert isinstance(id, int)

        self.open_session()
        to_delete = self.get(id)
        self.session.delete(to_delete)
        self.save()
1272930
def delete_by_ids(self, ids):
        
        ids = utils.coerce_to_list(ids)
        uri = "/%s?ids=%s" % (self.uri_base, ",".join(ids))
        return self.api.method_delete(uri)
1256825
public function delete(KDatabaseRowInterface $row)
    {
        // Create query object.
        $query = $this->getObject('lib:database.query.delete')
            ->table($this->getBase());

        //Create commandchain context
        $context = $this->getContext();
        $context->table     = $this->getBase();
        $context->data      = $row;
        $context->query     = $query;
        $context->affected  = false;

        if ($this->invokeCommand('before.delete', $context) !== false)
        {
            foreach ($this->getPrimaryKey() as $key => $column)
            {
                $context->query->where($column->name . ' = :' . $column->name)
                    ->bind(array($column->name => $context->data->$key));
            }

            // Execute the delete query.
            $context->affected = $this->getAdapter()->delete($context->query);

            // Set the query in the context.
            if ($context->affected !== false) {
                $context->data->setStatus($context->affected ? KDatabase::STATUS_DELETED : KDatabase::STATUS_FAILED);
            }

            $this->invokeCommand('after.delete', $context);
        }

        return $context->affected;
    }
797139
def delete(self,removed):
        
        sql = "DELETE FROM %s " %self.name
        if isinstance(removed,dict):
            # remove a single record
            _id = removed['__id__']
            sql += "WHERE rowid = ?"
            args = (_id,)
        else:
            # convert iterable into a list (to be able to sort it)
            removed = [ r for r in removed ]
            if not removed:
                return 0
            args = [ r['__id__'] for r in removed ]
            sql += "WHERE rowid IN (%s)" %(','.join(['?']*len(args)))
        self.cursor.execute(sql,args)
        return len(removed)
1345918
def _delete_reference_to_id(id)
      @data.delete_if do |k, v|
        v && v.respond_to?(:is_poxreference?) && v.id == id
      end
      @store.cache.cache_write(self)
    end
194638
protected function deleteByKey($id, string $key = null): int
    {
        $key = empty($key) ? $this->repository->getModel()->getKeyName() : $key;

        $row = 0;

        try {
            $row = $this->queryRelate->whereIn($key, (array) $id)->getQuery()->delete();
        } catch (\RuntimeException $exception) {
            throw new ResourceDeleteException($exception->getMessage(), $exception->getCode(), $exception);
        } finally {
            $this->resetQueryRelate();
        }

        return $row;
    }
575815
def delete(self, request, id):
        
        if not id:
            # can't delete the whole container
            raise errors.MethodNotAllowed()
        try:
            models.User.objects.get(pk=id).delete()
        except models.User.DoesNotExist:
            # we never had it, so it's definitely deleted
            pass
787031
def delete(id):
    
    post = get_post(id)
    db.session.delete(post)
    db.session.commit()
    return redirect(url_for("blog.index"))
1314167
private function page_delete( $table_name, $row_id ){
		$page_delete = new endpoint_form_delete($this->exdb, $this, $table_name, $row_id);
		return $page_delete->execute();
	}
1267926
public function delete(DatabaseRowInterface $row)
    {
        // Create query object.
        $query = $this->getObject('lib:database.query.delete')
            ->table($this->getBase());

        //Create commandchain context
        $context = $this->getContext();
        $context->table     = $this->getBase();
        $context->data      = $row;
        $context->query     = $query;
        $context->affected  = false;

        if ($this->invokeCommand('before.delete', $context) !== false)
        {
            foreach ($this->getPrimaryKey() as $key => $column)
            {
                $context->query->where($column->name . ' = :' . $column->name)
                    ->bind(array($column->name => $context->data->$key));
            }

            // Execute the delete query.
            $context->affected = $this->getDriver()->delete($context->query);

            // Set the query in the context.
            if ($context->affected !== false) {
                $context->data->setStatus($context->affected ? Database::STATUS_DELETED : Database::STATUS_FAILED);
            }

            $this->invokeCommand('after.delete', $context);
        }

        return $context->affected;
    }
1029500
public int deleteById(DatabaseConnection databaseConnection, ID id, ObjectCache objectCache) throws SQLException {
		try {
			Object[] args = new Object[] { convertIdToFieldObject(id) };
			int rowC = databaseConnection.delete(statement, args, argFieldTypes);
			logger.debug("delete data with statement '{}' and {} args, changed {} rows", statement, args.length, rowC);
			if (args.length > 0) {
				// need to do the (Object) cast to force args to be a single object
				logger.trace("delete arguments: {}", (Object) args);
			}
			if (rowC > 0 && objectCache != null) {
				objectCache.remove(clazz, id);
			}
			return rowC;
		} catch (SQLException e) {
			throw SqlExceptionUtil.create("Unable to run deleteById stmt on id " + id + ": " + statement, e);
		}
	}
486624
@Override
    public void delete(String id) throws SQLException {
        Connection c = dataSource.getConnection();
        PreparedStatement p = c.prepareStatement(deleteStatement());
        p.setString(1, id);
        p.execute();


    }
530100
def delete(context, id, etag):
    
    result = feeder.delete(context, id=id, etag=etag)

    if result.status_code == 204:
        utils.print_json({'id': id, 'message': 'Feeder deleted.'})
    else:
        utils.format_output(result, context.format)
1276843
def delete_row(self, index):
        "
        body = {
            "requests": [{
                "deleteDimension": {
                    "range": {
                      "sheetId": self.id,
                      "dimension": "ROWS",
                      "startIndex": index - 1,
                      "endIndex": index
                    }
                }
            }]
        }

        return self.spreadsheet.batch_update(body)