From 416c3863a0e0d2e78793efea01e50ce9058986b6 Mon Sep 17 00:00:00 2001 From: Nuno Cruces Date: Wed, 1 Mar 2023 13:27:50 +0000 Subject: [PATCH] Documentation, tests, dependencies. --- README.md | 2 +- go.mod | 4 +++- go.sum | 4 ++-- tests/parallel/parallel_test.go | 11 +++++++++-- tx.go | 1 + 5 files changed, 16 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 048a93a..ebda141 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Go Reference](https://pkg.go.dev/badge/image)](https://pkg.go.dev/github.com/ncruces/go-sqlite3) [![Go Report](https://goreportcard.com/badge/github.com/ncruces/go-sqlite3)](https://goreportcard.com/report/github.com/ncruces/go-sqlite3) -[![Go Coverage](https://github.com/ncruces/go-sqlite3/wiki/coverage.svg)](https://raw.githack.com/wiki/ncruces/go-sqlite3/coverage.html) +[![Go Coverage](https://github.com/ncruces/go-sqlite3/wiki/coverage.svg)](https://github.com/ncruces/go-sqlite3/wiki/Test-coverage-report) Go module `github.com/ncruces/go-sqlite3` wraps a [WASM](https://webassembly.org/) build of [SQLite](https://sqlite.org/), and uses [wazero](https://wazero.io/) to provide `cgo`-free SQLite bindings. diff --git a/go.mod b/go.mod index e3d239e..409fe70 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,9 @@ go 1.19 require ( github.com/ncruces/julianday v0.1.5 - github.com/tetratelabs/wazero v1.0.0-pre.9 + github.com/tetratelabs/wazero v1.0.0-rc.1 golang.org/x/sync v0.1.0 golang.org/x/sys v0.5.0 ) + +retract v0.4.0 // tagged from the wrong branch diff --git a/go.sum b/go.sum index 6a067c8..20bb936 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,7 @@ github.com/ncruces/julianday v0.1.5 h1:hDJ9ejiMp3DHsoZ5KW4c1lwfMjbARS7u/gbYcd0FBZk= github.com/ncruces/julianday v0.1.5/go.mod h1:Dusn2KvZrrovOMJuOt0TNXL6tB7U2E8kvza5fFc9G7g= -github.com/tetratelabs/wazero v1.0.0-pre.9 h1:2uVdi2bvTi/JQxG2cp3LRm2aRadd3nURn5jcfbvqZcw= -github.com/tetratelabs/wazero v1.0.0-pre.9/go.mod h1:wYx2gNRg8/WihJfSDxA1TIL8H+GkfLYm+bIfbblu9VQ= +github.com/tetratelabs/wazero v1.0.0-rc.1 h1:ytecMV5Ue0BwezjKh/cM5yv1Mo49ep2R2snSsQUyToc= +github.com/tetratelabs/wazero v1.0.0-rc.1/go.mod h1:wYx2gNRg8/WihJfSDxA1TIL8H+GkfLYm+bIfbblu9VQ= golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= diff --git a/tests/parallel/parallel_test.go b/tests/parallel/parallel_test.go index 5ad9129..df10f51 100644 --- a/tests/parallel/parallel_test.go +++ b/tests/parallel/parallel_test.go @@ -14,8 +14,15 @@ import ( ) func TestParallel(t *testing.T) { + var iter int + if testing.Short() { + iter = 1000 + } else { + iter = 5000 + } + name := filepath.Join(t.TempDir(), "test.db") - testParallel(t, name, 1000) + testParallel(t, name, iter) testIntegrity(t, name) } @@ -135,7 +142,7 @@ func testParallel(t *testing.T, name string, n int) { } var group errgroup.Group - group.SetLimit(4) + group.SetLimit(6) for i := 0; i < n; i++ { if i&7 != 7 { group.Go(reader) diff --git a/tx.go b/tx.go index 8d33096..73506ac 100644 --- a/tx.go +++ b/tx.go @@ -7,6 +7,7 @@ import ( "runtime" ) +// Tx is an in-progress database transaction. type Tx struct { c *Conn }