This function generates an SQL query based on a specified connection, argument, and join path list. It constructs a query that performs joins on multiple tables according to the provided join path, incorporating requested variables and filter conditions as needed.
add_join_paths_to_query(
conn,
filter_statements,
join_path_list,
argument_sequence,
requested_vars = NULL,
filter_variables = NULL
)A SQL query string that represents the joined tables and requested variables.
The connection object or database connection string.
The SQL-Filter statements extracted from the filter arguments list via 'get_filter_statement()'.
A list representing the join path. Each element of the list should be a data frame describing a step in the join path with columns: "table_to_join", "method", and "common_var".
A numeric vector representing the AND/OR sequence of arguments.
A character vector specifying the variables to be selected from the final query result.
If NULL, all variables are selected.
A character vector specifying the variables needed for filtering