Skip to content

Commit 9d75c39

Browse files
committed
Update README.md
1 parent 746a849 commit 9d75c39

File tree

1 file changed

+30
-9
lines changed

1 file changed

+30
-9
lines changed

README.md

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,25 @@ Go module `github.com/ncruces/go-sqlite3` wraps a [WASM](https://webassembly.org
88
and uses [wazero](https://wazero.io/) to provide `cgo`-free SQLite bindings.
99

1010
- Package [`github.com/ncruces/go-sqlite3`](https://pkg.go.dev/github.com/ncruces/go-sqlite3)
11-
wraps the [C SQLite API](https://www.sqlite.org/cintro.html)
12-
([example usage](https://pkg.go.dev/github.com/ncruces/go-sqlite3#example-package)).
11+
wraps the [C SQLite API](https://www.sqlite.org/cintro.html)
12+
([example usage](https://pkg.go.dev/github.com/ncruces/go-sqlite3#example-package)).
1313
- Package [`github.com/ncruces/go-sqlite3/driver`](https://pkg.go.dev/github.com/ncruces/go-sqlite3/driver)
14-
provides a [`database/sql`](https://pkg.go.dev/database/sql) driver
15-
([example usage](https://pkg.go.dev/github.com/ncruces/go-sqlite3/driver#example-package)).
14+
provides a [`database/sql`](https://pkg.go.dev/database/sql) driver
15+
([example usage](https://pkg.go.dev/github.com/ncruces/go-sqlite3/driver#example-package)).
1616
- Package [`github.com/ncruces/go-sqlite3/embed`](https://pkg.go.dev/github.com/ncruces/go-sqlite3/embed)
17-
embeds a build of SQLite into your application.
17+
embeds a build of SQLite into your application.
1818
- Package [`github.com/ncruces/go-sqlite3/vfs`](https://pkg.go.dev/github.com/ncruces/go-sqlite3/vfs)
19-
wraps the [C SQLite VFS API](https://www.sqlite.org/vfs.html) and provides a pure Go implementation.
19+
wraps the [C SQLite VFS API](https://www.sqlite.org/vfs.html) and provides a pure Go implementation.
20+
- Package [`github.com/ncruces/go-sqlite3/vfs/memdb`](https://pkg.go.dev/github.com/ncruces/go-sqlite3/vfs/memdb)
21+
implements an in-memory VFS.
22+
- Package [`github.com/ncruces/go-sqlite3/vfs/readervfs`](https://pkg.go.dev/github.com/ncruces/go-sqlite3/vfs/readervfs)
23+
implements a VFS for immutable databases.
24+
- Package [`github.com/ncruces/go-sqlite3/ext/unicode`](https://pkg.go.dev/github.com/ncruces/go-sqlite3/ext/unicode)
25+
registers Unicode aware functions.
26+
- Package [`github.com/ncruces/go-sqlite3/ext/stats`](https://pkg.go.dev/github.com/ncruces/go-sqlite3/vfs/stats)
27+
registers [statistics functions](https://www.oreilly.com/library/view/sql-in-a/9780596155322/ch04s02.html).
2028
- Package [`github.com/ncruces/go-sqlite3/gormlite`](https://pkg.go.dev/github.com/ncruces/go-sqlite3/gormlite)
21-
provides a [GORM](https://gorm.io) driver.
29+
provides a [GORM](https://gorm.io) driver.
2230

2331
### Caveats
2432

@@ -35,7 +43,8 @@ To work around this limitation, SQLite is [patched](sqlite3/locking_mode.patch)
3543
to always use `EXCLUSIVE` locking mode for WAL databases.
3644

3745
Because connection pooling is incompatible with `EXCLUSIVE` locking mode,
38-
to open WAL databases you should disable connection pooling by calling
46+
to use the [`database/sql`](https://pkg.go.dev/database/sql)
47+
driver with WAL databases you should disable connection pooling by calling
3948
[`db.SetMaxOpenConns(1)`](https://pkg.go.dev/database/sql#DB.SetMaxOpenConns).
4049

4150
#### POSIX Advisory Locks
@@ -53,6 +62,18 @@ On BSD Unixes, this module uses
5362
BSD locks may _not_ be compatible with process-associated POSIX advisory locks
5463
(they are on FreeBSD).
5564

65+
##### TL;DR
66+
67+
In all platforms for which this package builds,
68+
it is safe to use it to access databases concurrently from multiple goroutines.
69+
70+
Additionally, on Windows, Linux, macOS, illumos and FreeBSD,
71+
it is _also_ safe to use it to access databases concurrently
72+
with _other_ implementations of SQLite.
73+
74+
On other BSDs, where this might be unsafe,
75+
[this test](https://github.com/ncruces/go-sqlite3/blob/main/vfs/lock_test.go) should fail.
76+
5677
#### Testing
5778

5879
The pure Go VFS is tested by running SQLite's
@@ -82,4 +103,4 @@ Performance is tested by running
82103
- [`modernc.org/sqlite`](https://pkg.go.dev/modernc.org/sqlite)
83104
- [`crawshaw.io/sqlite`](https://pkg.go.dev/crawshaw.io/sqlite)
84105
- [`github.com/mattn/go-sqlite3`](https://pkg.go.dev/github.com/mattn/go-sqlite3)
85-
- [`github.com/zombiezen/go-sqlite`](https://pkg.go.dev/github.com/zombiezen/go-sqlite)
106+
- [`github.com/zombiezen/go-sqlite`](https://pkg.go.dev/github.com/zombiezen/go-sqlite)

0 commit comments

Comments
 (0)