neon_db.RdCache-able duckdb database connection
neon_db(
dir = neon_db_dir(),
read_only = TRUE,
memory_limit = getOption("duckdb_memory_limit", NA),
...
)Location where files should be downloaded. By default will
use the appropriate applications directory for your system
(see tools::R_user_dir()). This default also be configured by
setting the environmental variable NEONSTORE_HOME, see Sys.setenv or
Renviron.
allow concurrent connections by enforcing read_only. See details.
Set a memory limit for duckdb, in GB. This can
also be set for the session by using options, e.g.
options(duckdb_memory_limit=10) for a limit of 10GB. On most systems
duckdb will automatically set a limit to 80% of machine capacity if not
set explicitly.
additional arguments to dbConnect
Creates a connection to a permanent duckdb database
instance in the provided directory (see neon_dir()). This
connection is also cached, so that code which repeatedly calls
[neon_db] will not stall or hang. Only read_only connections
will be cached.
NOTE: [duckdb::duckdb()] can only support a single read-write connection
at a time. The default option of read_only = TRUE allows
multiple connections. [neon_store()] will automatically set this to
FALSE to allow data import.
# tempfile used for illustration only
neon_db(tempfile())
#> initializing database
#> <duckdb_connection addb0 driver=<duckdb_driver dbdir='/tmp/RtmpvWqYJ0/file17c643bfce7a/database' read_only=TRUE bigint=numeric>>