mutecomm / go-sqlcipher

Self-contained Go sqlite3 driver with an AES-256 encrypted sqlite3 database
Other
159 stars 60 forks source link

Concurrency #11

Closed fabiante closed 4 years ago

fabiante commented 4 years ago

Hi, thanks for this nice module, I had trouble using other sqlite encryption modules, this simply works.

One question: Is the package safe to be used by multiple goroutines? i. e.: I use the sqlite file as the database for a small webservice that could potentially handle many requests at once. Therefore I have to assume that database writes may happen concurrently.

Thanks in advance

frankbraun commented 4 years ago

Yes, the package is thread-safe.

https://golang.org/pkg/database/sql/#Open is inherently thread-safe.

See also the discussion https://github.com/mattn/go-sqlite3/issues/249 for more details