From 17b720a2173f2703941587e1e2688f1eb8f43904 Mon Sep 17 00:00:00 2001 From: Nuno Cruces Date: Thu, 26 Jan 2023 01:11:09 +0000 Subject: [PATCH] Update README.md --- .github/coverage.sh | 15 +++++++++++++++ .github/coverage.svg | 1 + README.md | 28 ++++++++-------------------- go.mod | 1 - go.sum | 3 --- 5 files changed, 24 insertions(+), 24 deletions(-) create mode 100755 .github/coverage.sh create mode 100644 .github/coverage.svg diff --git a/.github/coverage.sh b/.github/coverage.sh new file mode 100755 index 0000000..3a72ea5 --- /dev/null +++ b/.github/coverage.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +set -eo pipefail + +cd -P -- "$(dirname -- "$0")" + +go test ../... -coverprofile coverage.svg +COVERAGE=$(go tool cover -func=coverage.svg | grep total: | grep -Eo '[0-9]+\.[0-9]+') +echo $COVERAGE +COLOR=orange +if (( $(echo "$COVERAGE <= 50" | bc -l) )) ; then + COLOR=red +elif (( $(echo "$COVERAGE > 80" | bc -l) )); then + COLOR=green +fi +curl -s "https://img.shields.io/badge/coverage-$COVERAGE%25-$COLOR" > coverage.svg diff --git a/.github/coverage.svg b/.github/coverage.svg new file mode 100644 index 0000000..c7f0b3f --- /dev/null +++ b/.github/coverage.svg @@ -0,0 +1 @@ +coverage: 50.6%coverage50.6% \ No newline at end of file diff --git a/README.md b/README.md index f4de2ec..9b696ad 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,13 @@ # Go bindings to SQLite using Wazero -⚠️ DO NOT USE with data you care about. ⚠️ +[![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](.github/coverage.svg) -This is very much a WIP. +⚠️ CAUTION ⚠️ + +This is still very much a WIP.\ +DO NOT USE this with data you care about. Roadmap: - [x] build SQLite using `zig cc --target=wasm32-wasi` @@ -11,21 +16,4 @@ Roadmap: - branch [`wasi`](https://github.com/ncruces/go-sqlite3/tree/wasi) uses `test_demovfs.c` directly - [x] come up with a simple, nice API, enough for simple queries - [ ] file locking, compatible with SQLite on Windows/Unix -- [ ] ~shared-memory, compatible with SQLite on Windows/Unix~ - -Benchmarks: - -``` -goos: darwin -goarch: amd64 -pkg: github.com/ncruces/go-sqlite3/bench -cpu: Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz - -BenchmarkCrawshaw-12 8 677059222 ns/op 104003008 B/op 9000000 allocs/op -BenchmarkWasm-12 8 702393992 ns/op 178750252 B/op 11000110 allocs/op -BenchmarkWASI-12 5 1015034369 ns/op 178750009 B/op 11000102 allocs/op - -BenchmarkCrawshawFile-12 8 704186415 ns/op 104002593 B/op 8999998 allocs/op -BenchmarkWasmFile-12 5 1029067495 ns/op 178750070 B/op 11000102 allocs/op -BenchmarkWASIFile-12 3 2226217997 ns/op 868255072 B/op 16000200 allocs/op -``` +- [ ] ~shared-memory, compatible with SQLite on Windows/Unix~ \ No newline at end of file diff --git a/go.mod b/go.mod index 312fa1b..4fc635a 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,6 @@ module github.com/ncruces/go-sqlite3 go 1.19 require ( - crawshaw.io/sqlite v0.3.2 github.com/ncruces/julianday v0.1.3 github.com/tetratelabs/wazero v1.0.0-pre.7.0.20230117161130-15889085a5ca ) diff --git a/go.sum b/go.sum index 4e642dc..d53e1ee 100644 --- a/go.sum +++ b/go.sum @@ -1,6 +1,3 @@ -crawshaw.io/iox v0.0.0-20181124134642-c51c3df30797/go.mod h1:sXBiorCo8c46JlQV3oXPKINnZ8mcqnye1EkVkqsectk= -crawshaw.io/sqlite v0.3.2 h1:N6IzTjkiw9FItHAa0jp+ZKC6tuLzXqAYIv+ccIWos1I= -crawshaw.io/sqlite v0.3.2/go.mod h1:igAO5JulrQ1DbdZdtVq48mnZUBAPOeFzer7VhDWNtW4= github.com/ncruces/julianday v0.1.3 h1:+JRqsbdGH8QlPWlB6i/pD8sENBZZ1qg24qBCAcYfGMU= github.com/ncruces/julianday v0.1.3/go.mod h1:Dusn2KvZrrovOMJuOt0TNXL6tB7U2E8kvza5fFc9G7g= github.com/tetratelabs/wazero v1.0.0-pre.7.0.20230117161130-15889085a5ca h1:cvbRnzLE99QnA6HT3yoqXjWEB2JMiyTs3GSLpQZg45A=