I am using node-red-node-sqlite to connect to a sqlite3 db. I need to load a sqlite extension prior to submitting a select.
When I do this at the command line, it seems to work ok:
SELECT id, (6371000 * acos ( cos ( radians(42.48) ) * cos ( radians ( latitude ) ) * cos( radians( longitude ) - radians(-70.8) ) + sin ( radians(42.48) ) * sin( radians( latitude ) ) ) ) AS distance, ssid from log order by distance;
I am getting this from nodered:
Error: SQLITE_ERROR: not authorized
The error seems to be in response to the ‘select load_extension() call.
I have tried to use msg.topic, fixed statement and prepared statement.
So Im wondering if:
-There might be a way to have the select load_extension automatically execute upon connect? From what I understand sqlite3 can accept a 2nd argument (after the db name) that is a SQL statement.
-Perhaps Im not using the node correctly?