R/templates.R

Defines functions custom_flist_template custom_q_template aggregate_q_template lb_compound_template flist_template

flist_template <- function() {
"
select {{{table}}}.{{{to}}} as {{{id_type}}}
from {{{schema}}}.{{{table}}}
where
{{#haswhere}}
{{{where}}}
and
{{/haswhere}}
{{{from}}} in ({{{original_query}}})
{{#hashaving}}
group by {{{table}}}.{{{to}}}
having {{{having}}}
{{/hashaving}}
"
}

lb_compound_template <- function() {
"({{{block1}}}
{{{operator}}}
{{{block2}}})"
}

aggregate_q_template <- function() {
"
select {{{table}}}.{{{id_field}}} as {{{id_type}}}
from {{{schema}}}.{{{table}}}
{{#haswhere}}
where {{{where}}}
{{/haswhere}}
{{#hashaving}}
group by {{{table}}}.{{{id_field}}}
having {{{having}}}
{{/hashaving}}
"
}

custom_q_template <- function() {
"
select {{{id_field}}} as {{{id_type}}}
from ({{{custom}}})
{{#haswhere}}
where {{{where}}}
{{/haswhere}}
{{#hashaving}}
group by {{{id_field}}}
having {{{having}}}
{{/hashaving}}
"
}

custom_flist_template <- function() {
    "
select {{{to}}} as {{{id_type}}}
from ({{{custom}}})
where
{{#haswhere}}
{{{where}}}
and
{{/haswhere}}
{{{from}}} in ({{{original_query}}})
{{#hashaving}}
group by {{{to}}}
having {{{having}}}
{{/hashaving}}
"
}
tarakc02/listbuilder documentation built on Jan. 27, 2024, 7:48 p.m.