sqliteExtension: Load an SQLite extension into an SQL database

Description Usage Arguments Value Author(s) References Examples

View source: R/initExtension.R

Description

This function is a generalization of initExtension in the RSQLite package. This allows us to load extensions from different compiled DLLs/DSOs.

Usage

1
sqliteExtension(db, dll = getLoadedDLLs()[[pkg]][["path"]], pkg = "RSQLite")

Arguments

db

the SQLite database connection into which the extension will be loaded. The extension needs to be loaded for each new database.

dll

the full path the DLL containing the compiled code.

pkg

the name of an R package whose compiled code contains the extension code. This is a more convenient way to locate the DLL/DSO.

Value

This function is used for its side effect.

Author(s)

Duncan Temple Lang, adapted from initExtension in RSQLite.

References

https://www.sqlite.org/loadext.html

Examples

1
2
3
4
library(RSQLite)
db = dbConnect(SQLite(), ":memory:")
sqliteExtension(db, pkg = "RSQLite")
sqliteExtension(db, pkg = "RSQLiteUDF")

duncantl/RSQLiteUDF documentation built on Jan. 5, 2021, 7:55 a.m.