Skip to contents

Run a SeaTable SQL query

Usage

hb_query(client, sql, ..., parameters = NULL, convert_keys = TRUE)

Arguments

client

A harbour_client.

sql

SeaTable SQL query string. SeaTable applies an implicit LIMIT 100 when the query has none, and caps results at 10000 rows. harbouR warns if there is no LIMIT clause - the word inside a quoted string or a back-ticked name does not count - at most once every eight hours for the same query, so a loop does not repeat it.

...

These dots are for future extensions and must be empty.

parameters

Optional list of values for ? placeholders in sql, in order. Names are ignored.

convert_keys

Return column names rather than column keys. Default TRUE.

Value

A tibble, typed from the result schema SeaTable reports alongside the rows, so the same table read via hb_read_table() and via hb_query() yields the same column types. Always a tibble, even when the query returns no rows.

Examples

# needs a SeaTable server and an API token
if (FALSE) { # \dontrun{
client <- hb_client()
hb_query(client, "select * from Samples limit 5")
} # }