I am attempting to do a few short spatial queries using a spatialite database from clojure. I am using the xerial sqlite-jdbc connector to connect.
My attempt at loading the spatialite extension fails with a "not authorized" error:
(sql/with-connection db
(try
(sql/with-query-results foo
["SELECT load_extension('/usr/local/lib/libspatialite.dylib');"]
(dorun (map #(println foo))))
(catch Exception e (print e))))
#<SQLException java.sql.SQLException: [SQLITE_ERROR] SQL error or missing database (not authorized)>#<SQLException java.sql.SQLException: [SQLITE_ERROR] SQL error or missing database (not authorized)>
This page describes a method in Java wherein you instantiate a SQLiteConfig object, set some attributes, and then pass the configuration object when setting up the database connection.
Being new to Clojure, this is breaking my brain. Can anyone provide an example of connecting to a spatialite-enable sqlite database?