| dbSendQueryArrow_AdbiConnection {adbi} | R Documentation |
Create result sets
Description
Creating result sets using dbSendQuery() (and by extension using
dbGetQuery()) mostly follows DBI specification. One way where adbi
deviates from DBI mechanisms is how the bigint setting is not only per
connection, but the per-connection setting can be overridden on a result
set basis. As default, the connection setting is applied, but passing one
of the accepted values as bigint when creating a result set will
subsequently use that setting for all fetches using this result set.
Usage
## S4 method for signature 'AdbiConnection'
dbSendQueryArrow(
conn,
statement,
...,
params = NULL,
immediate = NULL,
bigint = NULL
)
## S4 method for signature 'AdbiConnection,character'
dbSendQuery(
conn,
statement,
...,
params = NULL,
immediate = NULL,
bigint = NULL
)
## S4 method for signature 'AdbiConnection,character'
dbSendStatement(
conn,
statement,
...,
params = NULL,
immediate = NULL,
bigint = NULL
)
Arguments
conn |
A DBIConnection object, as returned by
|
statement |
a character string containing SQL. |
... |
Other parameters passed on to methods. |
params |
Optional query parameters (forwarded to |
immediate |
Passing a value |
bigint |
The R type that 64-bit integer types should be mapped to, default is chosen according to the connection setting |
Details
Multiple open result sets per connection are supported and support can
be disabled by setting options(adbi.allow_multiple_results = FALSE). If
not enabled, creating a new result will finalize potential other results
and throw a warning.
Value
An S4 class AdbiResult (inheriting from DBIResult).
See Also
adbi-driver
Examples
if (requireNamespace("adbcsqlite")) {
library(DBI)
con <- dbConnect(adbi::adbi("adbcsqlite"), uri = ":memory:")
dbWriteTable(con, "swiss", swiss)
str(
dbGetQuery(con, "SELECT Examination from swiss WHERE Agriculture < 30")
)
str(
dbGetQuery(con, "SELECT Examination from swiss WHERE Agriculture < 30",
bigint = "integer")
)
dbDisconnect(con)
}