Skip to content

Commit ded1ba6

Browse files
committed
add a FAQ entry about :memory: races
Closes #204 Closes #309 Signed-off-by: Tycho Andersen <[email protected]>
1 parent 7ed900a commit ded1ba6

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

README.md

+9
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,15 @@ FAQ
6868

6969
Yes for readonly. But, No for writable. See #50, #51, #209.
7070

71+
* Why is it racy if I use a `sql.Open("sqlite", ":memory:")` database?
72+
73+
Each connection to :memory: opens a brand new in-memory sql database, so if
74+
the stdlib's sql engine happens to open another connection and you've only
75+
specified ":memory:", that connection will see a brand new database. A
76+
workaround is to use "file::memory:?mode=memory&cache=shared". Every
77+
connection to this string will point to the same in-memory database. See
78+
#204 for more info.
79+
7180
License
7281
-------
7382

0 commit comments

Comments
 (0)