I'm opening a connection to a sqlite database of the user's choosing in my golang program. If they supply a path to a non-existent file then I want to throw an error instead of creating the file.
I'm using the mattn/gp-sqlite3 driver. The documentation doesn't mention this capability as far as I can see.
- The sqlite C documentation mentions the querystring format but not the existence of the target file.
- The C# connection strings have a
FailIfMissing
option but are in a different format.
This is the same as Make SQLite connection fail if database is missing? (deleted/moved) but for golang instead of C#. The golang driver seems to use a different format for describing connections to the C# driver so I don't know if the answers there translate to golang or not.