[R-sig-DB] RSQLite load extension

Alex Mandel tech_dev @end|ng |rom w||d|nte||ect@com
Sun Feb 21 05:20:05 CET 2010


Does anyone have a working example of loading an SQLite extension.
(There was a similar email in Nov but no answer)

I've tried the following, and it doesn't throw any errors during the
load, but none of the extension functions work those throw errors.

library(RSQLite)
m <- dbDriver("SQLite")
con <- dbConnect(m, dbname = "test.db",loadable.extensions = TRUE)
sql <- "SELECT load_extension('libspatialite.so')"
rs <- dbSendQuery(con, sql)
dbGetException(con)
dbClearResult(rs)

sql <- "SELECT id, AsText(geom) as points FROM locations Limit 10;"
dtest <- dbGetQuery(con, sql)
Error in sqliteExecStatement(con, statement, bind.data) :
  RS-DBI driver: (error in statement: no such function: AsText)

This query works fine via other SQLite interfaces.

Thanks,
Alex




More information about the R-sig-DB mailing list