Builds and runs a SELECT ... WHERE <idfield> IN (...) query
for a set of ids – a convenience over writing the SQL by hand. With no
ids it returns the whole table.
Usage
seatable_list_selected(
ids = NULL,
table,
fields = "*",
idfield = NULL,
base = NULL,
con = default_connection(),
...
)Arguments
- ids
Ids to look up, matched against
idfield.NULL(the default) returns every row.- table
Name of the table.
- fields
Columns to return:
"*"(default) for all, a comma-separated string, or a character vector of column names (back-quoted for you).- idfield
Column to match
idsagainst. Required whenidsis supplied.- base
Optional base name or
Baseobject; discovered fromtablewhenNULL.- con
- ...
Passed to
seatable_query()(e.g.limit,python,collapse_lists).
Details
This is a generic id lookup: ids are matched against idfield
verbatim, with no coercion. Consumer packages that key on a domain id (for
example a flywire root id that must be resolved to its current value first)
should do that resolution in their own wrapper before calling this.
Whether values are quoted in the SQL is decided from idfield's column
type (numeric columns are left unquoted).