Run a SQL query against a SeaTable server
Usage
seatable_query(
sql,
con = default_connection(),
limit = 100000L,
base = NULL,
python = FALSE,
convert = TRUE,
paginate = TRUE,
chunksize = NULL,
collapse_lists = TRUE,
retries = 3L,
progress = interactive()
)Arguments
- sql
A single SQL
SELECTstatement. The table name is parsed from theFROMclause.- con
- limit
Maximum rows to return. The default fetches all rows, paginating as needed.
- base
Optional base name or
Baseobject; discovered from the table name whenNULL.- python
If
TRUE, return the raw pandasDataFrameinstead of an Rdata.frame.- convert
Passed to the SeaTable Python
querycall.- paginate
Whether to page through large results automatically (default
TRUE). SeaTable's SQL endpoint silently caps a single call at a server-specific maximum; pagination returns the full result.- chunksize
Advanced: force
LIMIT/OFFSETpaging in fixed windows of this size. The defaultNULLauto-detects the server's per-call cap.- collapse_lists
Whether to collapse multiple-select (and other list) columns into simple character vectors. The default
TRUEcomma-joins multi-valued cells;FALSEkeeps them as list-columns. A string is used as the separator instead of",".- retries
Number of times to retry a page that fails because the server is rate-limiting us (HTTP 429), with exponential backoff between attempts. Long paginated reads are the usual way to hit a quota, and losing the whole read to one throttled page is expensive. Set to
0to fail fast.- progress
Whether to report each page of a paginated read as it arrives. Defaults to
TRUEin an interactive session. Reading a large table takes minutes, and silence is hard to distinguish from a hang.
Value
An R data.frame (or a pandas DataFrame when python = TRUE). If
a paginated read stops early because a page kept failing, the rows read so
far are returned along with a warning saying where it stopped, rather than
throwing away a read that may have taken minutes.
Examples
if (FALSE) { # \dontrun{
con <- seatable_connection("https://cloud.seatable.io/", "BANCTABLE_TOKEN",
workspace_id = "57832")
seatable_query("SELECT * FROM banc_meta", con = con)
} # }