From b34466c4231149a9679d0db832adf30b755cad90 Mon Sep 17 00:00:00 2001 From: Lukas Pietzschmann Date: Tue, 1 Oct 2024 11:16:19 +0200 Subject: [PATCH] Added request_query --- NAMESPACE | 1 + R/query.R | 22 ++++++++++++++++++++++ man/request_query.Rd | 29 +++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+) create mode 100644 R/query.R create mode 100644 man/request_query.Rd diff --git a/NAMESPACE b/NAMESPACE index 942303f..2cdd8c1 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -9,6 +9,7 @@ export(install_flowr) export(install_node) export(request_file_analysis) export(request_lineage) +export(request_query) export(request_repl) export(request_slice) export(send_request) diff --git a/R/query.R b/R/query.R new file mode 100644 index 0000000..e9de34b --- /dev/null +++ b/R/query.R @@ -0,0 +1,22 @@ +#' Sends a ["request-query"](https://github.com/flowr-analysis/flowr/wiki/Interface#the-query-request) request +#' +#' @param con The connection to the server +#' @param filetoken The filetoken of the file to be sliced +#' (retrieved by a previous "file-analysis" request) +#' @param query The query to be executed +#' @param id The id of the request +#' @return A list containing the id and the response +#' +#' @seealso [request_file_analysis()] +#' @seealso [connect()] +#' +#' @export +request_query <- function(con, filetoken, query, id = get_new_id()) { + request <- list( + type = "request-query", + id = id, + filetoken = filetoken, + query = I(query) + ) + return(send_request_handle_response(con, request)) +} diff --git a/man/request_query.Rd b/man/request_query.Rd new file mode 100644 index 0000000..ee9402a --- /dev/null +++ b/man/request_query.Rd @@ -0,0 +1,29 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/query.R +\name{request_query} +\alias{request_query} +\title{Sends a \href{https://github.com/flowr-analysis/flowr/wiki/Interface#the-query-request}{"request-query"} request} +\usage{ +request_query(con, filetoken, query, id = get_new_id()) +} +\arguments{ +\item{con}{The connection to the server} + +\item{filetoken}{The filetoken of the file to be sliced +(retrieved by a previous "file-analysis" request)} + +\item{query}{The query to be executed} + +\item{id}{The id of the request} +} +\value{ +A list containing the id and the response +} +\description{ +Sends a \href{https://github.com/flowr-analysis/flowr/wiki/Interface#the-query-request}{"request-query"} request +} +\seealso{ +\code{\link[=request_file_analysis]{request_file_analysis()}} + +\code{\link[=connect]{connect()}} +}