You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Generalize NASIS selected set argument and query templates
The selected set is just a view of the "full" set of local NASIS records that could be thought of as an independent set of tables.
An expression similar to below, where q is a character containing query written to get the selected set tables. Replacing '_View_1' with "" we get the local database table instead of the selected set view. This is used to implement selected set toggling in ~64 NASIS queries targeting "selectable" tables.
# toggle selected set vs. local DBif (SS==FALSE) {
q<- gsub(pattern='_View_1', replacement='', x=q, fixed=TRUE)
}
I think these identical query substitutions could be abstracted / integrated at lower level -- i.e. as arguments to dbQueryNASIS to allow for more options for appending suffixes onto standard NASIS table names.
Consider "_View_1" as a table name suffix placeholder, and the replacement could be anything if you have full control over the table names used in your DB. Using "" to replace is most common for standard NASIS, but a specific application of custom suffixes is where there are issues with capitalization or underscores in identifiers (Postgres), or there is a desire to work with multiple "selected sets" in a single database source.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Generalize NASIS selected set argument and query templates
The selected set is just a view of the "full" set of local NASIS records that could be thought of as an independent set of tables.
An expression similar to below, where
q
is a character containing query written to get the selected set tables. Replacing'_View_1'
with""
we get the local database table instead of the selected set view. This is used to implement selected set toggling in ~64 NASIS queries targeting "selectable" tables.I think these identical query substitutions could be abstracted / integrated at lower level -- i.e. as arguments to
dbQueryNASIS
to allow for more options for appending suffixes onto standard NASIS table names.Consider "_View_1" as a table name suffix placeholder, and the replacement could be anything if you have full control over the table names used in your DB. Using "" to replace is most common for standard NASIS, but a specific application of custom suffixes is where there are issues with capitalization or underscores in identifiers (Postgres), or there is a desire to work with multiple "selected sets" in a single database source.
Beta Was this translation helpful? Give feedback.
All reactions