diff options
-rw-r--r-- | .travis.yml | 4 | ||||
-rw-r--r-- | README.md | 31 |
2 files changed, 28 insertions, 7 deletions
diff --git a/.travis.yml b/.travis.yml index a6030cf..a21c817 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,10 +12,8 @@ env: matrix: - GOTAGS= - GOTAGS=libsqlite3 - - GOTAGS="sqlite_allow_uri_authority sqlite_app_armor sqlite_foreign_keys sqlite_fts5 sqlite_icu sqlite_introspect sqlite_json sqlite_secure_delete sqlite_see sqlite_stat4 sqlite_trace sqlite_userauth" + - GOTAGS="sqlite_allow_uri_authority sqlite_app_armor sqlite_foreign_keys sqlite_fts5 sqlite_icu sqlite_introspect sqlite_json sqlite_secure_delete sqlite_see sqlite_stat4 sqlite_trace sqlite_userauth sqlite_vacuum_incr sqlite_vtable" - GOTAGS=sqlite_vacuum_full - - GOTAGS=sqlite_vacuum_incr - - GOTAGS=sqlite_vtable go: - 1.9.x @@ -37,7 +37,6 @@ Supported Golang version: - [User Authentication](#user-authentication) - [Compile](#compile) - [Usage](#usage) - - - [Extensions](#extensions) - [Spatialite](#spatialite) - [FAQ](#faq) @@ -454,14 +453,19 @@ For an example see [shaxbee/go-spatialite](https://github.com/shaxbee/go-spatial Yes for readonly. But, No for writable. See [#50](https://github.com/mattn/go-sqlite3/issues/50), [#51](https://github.com/mattn/go-sqlite3/issues/51), [#209](https://github.com/mattn/go-sqlite3/issues/209), [#274](https://github.com/mattn/go-sqlite3/issues/274). -- Why is it racy if I use a `sql.Open("sqlite3", ":memory:")` database? +- Why I'm getting `no such table` error? + + Why is it racy if I use a `sql.Open("sqlite3", ":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](https://github.com/mattn/go-sqlite3/issues/204) for more info. + connection to this string will point to the same in-memory database. + + For more information see + * [#204](https://github.com/mattn/go-sqlite3/issues/204) + * [#511](https://github.com/mattn/go-sqlite3/issues/511) - Reading from database with large amount of goroutines fails on OSX. @@ -478,6 +482,25 @@ For an example see [shaxbee/go-spatialite](https://github.com/shaxbee/go-spatial More infomation see [#305](https://github.com/mattn/go-sqlite3/issues/305) +- Error: `database is locked` + + When you get an database is locked. Please use the following options. + + Add to DSN: `cache=shared` + + Example: + ```go + db, err := sql.Open("sqlite3", "file:locked.sqlite?cache=shared") + ``` + + Second please set the database connections of the SQL package to 1. + + ```go + db.SetMaxOpenConn(1) + ``` + + More information see [#209](https://github.com/mattn/go-sqlite3/issues/209) + # License MIT: http://mattn.mit-license.org/2018 |