diff options
| author | mattn <mattn.jp@gmail.com> | 2017-01-27 09:02:38 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-01-27 09:02:38 +0900 |
| commit | ce9149a3c941c30de51a01dbc5bc414ddaa52927 (patch) | |
| tree | fee334589e6f18b5e9a7da7dcd08fdfc74ee3b78 | |
| parent | fix test (diff) | |
| parent | add a FAQ entry about :memory: races (diff) | |
| download | golite-ce9149a3c941c30de51a01dbc5bc414ddaa52927.tar.gz golite-ce9149a3c941c30de51a01dbc5bc414ddaa52927.tar.xz | |
Merge pull request #376 from tych0/memory-faq
add a FAQ entry about :memory: races
| -rw-r--r-- | README.md | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -68,6 +68,15 @@ FAQ Yes for readonly. But, No for writable. See #50, #51, #209. +* Why is it racy if I use a `sql.Open("sqlite", ":memory:")` database? + + Each connection to :memory: opens a brand new in-memory sql database, so if + the stdlib's sql engine happens to open another connection and you've only + specified ":memory:", that connection will see a brand new database. A + workaround is to use "file::memory:?mode=memory&cache=shared". Every + connection to this string will point to the same in-memory database. See + #204 for more info. + License ------- |
