A convenience wrapper around DBI::dbConnect() using the airtable2()
driver. When base is specified, the connection shows that base's tables
directly. When base is omitted, all accessible bases are shown as schemas
in the connection pane. Use bases to restrict the pane to a specific
subset of bases.
Usage
air_connect(
base = NULL,
bases = NULL,
.token = NULL,
include_views = FALSE,
.connect_code = NULL
)Arguments
- base
Character. A Base ID (starts with
app) or a Base Name. IfNULL, connects to all accessible bases.- bases
Character vector of Base IDs or names. When supplied, the connection pane shows only those bases (as schemas). Cannot be combined with
base.- .token
Character. Airtable Personal Access Token (resolved via
air_token()ifNULL).- include_views
Logical. If
TRUE, views are included in the connection pane alongside tables. DefaultFALSE.- .connect_code
Character. Optional custom reconnect code for the IDE connection pane. Defaults to a
DBI::dbConnect()call. Set byair_pane()to useairtable2::air_pane()instead.
Value
An AirtableConnection object.
Examples
if (FALSE) { # \dontrun{
# Connect to a specific base by name
con <- air_connect(base = "Project Tracker")
# Connect to all accessible bases
con <- air_connect()
# Show only selected bases in the pane
con <- air_connect(bases = c("appXXXXXX", "appYYYYYY"))
} # }