R/get_connections.R

Defines functions get_connections

Documented in get_connections

#' Generates the SQL to find the connections for a node in the database
#'
#' @param source_id The identifier for the source node
#' @param target_id The identifier for the target node
#' @return A SQL statement to find the edge connecting two nodes
#' @export
get_connections <- function(source_id, target_id) {
  source_id <- as.character(source_id)
  target_id <- as.character(target_id)
  paste0("SELECT * FROM edges WHERE source = \"", source_id, "\" AND target = \"", target_id, "\";")
}

Try the simplegraphdb package in your browser

Any scripts or data that you put into this service are public.

simplegraphdb documentation built on March 12, 2021, 5:05 p.m.