How to use SQLite in your Go project

There are two popular options for using SQLite in your Go project:

Beyond that, there are a number of options when using SQLite which affect how it handles concurrency, WAL or not, etc. The Pocketbase source provides good defaults to start with. Start with these defaults (which you append to the filename when opening the database) – it will save you a lot strange DB errors when getting started – especially if you have concurrent accesses, which you will likely have in Go.

Pocketbase also shows how to use build tags to use one of the above implementations depending if CGO is enabled or not.