File tree 1 file changed +19
-1
lines changed
1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,6 @@ Supported Golang version:
37
37
- [ User Authentication] ( #user-authentication )
38
38
- [ Compile] ( #compile )
39
39
- [ Usage] ( #usage )
40
- -
41
40
- [ Extensions] ( #extensions )
42
41
- [ Spatialite] ( #spatialite )
43
42
- [ FAQ] ( #faq )
@@ -478,6 +477,25 @@ For an example see [shaxbee/go-spatialite](https://github.com/shaxbee/go-spatial
478
477
479
478
More infomation see [#305](https://github.com/mattn/go-sqlite3/issues/305)
480
479
480
+ - Error: `database is locked`
481
+
482
+ When you get an database is locked. Please use the following options.
483
+
484
+ Add to DSN: `cache=shared`
485
+
486
+ Example:
487
+ ```go
488
+ db, err := sql.Open("sqlite3", "file:locked.sqlite?cache=shared")
489
+ ```
490
+
491
+ Second please set the database connections of the SQL package to 1.
492
+
493
+ ```go
494
+ db.SetMaxOpenConn(1)
495
+ ```
496
+
497
+ More information see [#209](https://github.com/mattn/go-sqlite3/issues/209)
498
+
481
499
# License
482
500
483
501
MIT: http://mattn.mit-license.org/2018
You can’t perform that action at this time.
0 commit comments