Description Usage Arguments Examples
Creates a BigQuery DBI driver for use in DBI::dbConnect()
.
1 2 3 4 5 6 7 8 9 10 11 12 |
drv |
an object that inherits from DBIDriver, or an existing DBIConnection object (in order to clone an existing connection). |
project, dataset |
Project and dataset identifiers |
billing |
Identifier of project to bill. |
page_size |
Number of items per page. |
quiet |
If |
use_legacy_sql |
If |
bigint |
The R type that BigQuery's 64-bit integer types should be mapped to.
The default is |
... |
Other arguments for compatibility with generic; currently ignored. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | if (bq_testable()) {
con <- DBI::dbConnect(
bigquery(),
project = "publicdata",
dataset = "samples",
billing = bq_test_project()
)
con
DBI::dbListTables(con)
DBI::dbReadTable(con, "natality", n_max = 10)
# Create a temporary dataset to explore
ds <- bq_test_dataset()
con <- DBI::dbConnect(
bigquery(),
project = ds$project,
dataset = ds$dataset
)
DBI::dbWriteTable(con, "mtcars", mtcars)
DBI::dbReadTable(con, "mtcars")[1:6, ]
DBI::dbGetQuery(con, "SELECT count(*) FROM mtcars")
res <- DBI::dbSendQuery(con, "SELECT cyl, mpg FROM mtcars")
dbColumnInfo(res)
dbFetch(res, 10)
dbFetch(res, -1)
DBI::dbHasCompleted(res)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.