SQL Node - SQLite3

Hello!

I was reading the docs about the SQL Node, and I have a doubt when using SQLite:

It is possible to open a “.db” file? Or just “.sqlite”?

Thanks!

The SQL Node does accept files with the .db extension as well. It works with any file path as long as the underlying file represents a SQLite 3 database. We’ll update the documentation to make that more clear.

1 Like

Thanks!

And what about the syntax? Do I have to define my file path using quotation marks?
In all of my tries, I’m getting the error:
SQLITE_CANTOPEN: unable to open database file

@Kelvin_Andrade1,

Is your DB mounted into the container? Since the Edge Agent runs with Docker, you have to give access to the host filesystem explicitly.

docker run -d --restart always --name docs-agent \
  -v /var/lib/losant-edge-agent/data:/data \
  -v /var/lib/losant-edge-agent/config.toml:/etc/losant/losant-edge-agent-config.toml \
  losant/edge-agent
  -v /path/to/db/outside/the/container:/path/to/inside/db \

If not, the one other thing you should double-check is its file permissions.

Hopefully, it’s one of the two. If not, let me know and we can figure out what’s going on

1 Like

Hello @anaptfox!

Thanks for your help, it worked!

1 Like