Fix wasm build
This was broken in the move to zombiezen sqlite, which still doesn't work on WASM/JS.
This commit is contained in:
parent
22053c9238
commit
7197c5f493
|
@ -0,0 +1,11 @@
|
|||
// Bolt piece completion is available, and sqlite is not.
|
||||
//go:build !noboltdb && !wasm && (js || nosqlite)
|
||||
// +build !noboltdb
|
||||
// +build !wasm
|
||||
// +build js nosqlite
|
||||
|
||||
package storage
|
||||
|
||||
func NewDefaultPieceCompletionForDir(dir string) (PieceCompletion, error) {
|
||||
return NewBoltPieceCompletion(dir)
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
//go:build wasm
|
||||
// +build wasm
|
||||
// Bolt piece completion is not available, and neither is sqlite.
|
||||
//go:build wasm || noboltdb
|
||||
// +build wasm noboltdb
|
||||
|
||||
package storage
|
||||
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
//go:build !nosqlite
|
||||
// +build !nosqlite
|
||||
|
||||
package storage
|
||||
|
||||
func NewDefaultPieceCompletionForDir(dir string) (PieceCompletion, error) {
|
||||
return NewSqlitePieceCompletion(dir)
|
||||
}
|
|
@ -1,5 +1,7 @@
|
|||
//go:build !nosqlite
|
||||
// +build !nosqlite
|
||||
// modernc.org/sqlite depends on modernc.org/libc which doesn't work for JS (and probably wasm but I
|
||||
// think JS is the stronger signal).
|
||||
//go:build !js && !nosqlite
|
||||
// +build !js,!nosqlite
|
||||
|
||||
package storage
|
||||
|
||||
|
@ -13,6 +15,11 @@ import (
|
|||
"zombiezen.com/go/sqlite/sqlitex"
|
||||
)
|
||||
|
||||
// sqlite is always the default when available.
|
||||
func NewDefaultPieceCompletionForDir(dir string) (PieceCompletion, error) {
|
||||
return NewSqlitePieceCompletion(dir)
|
||||
}
|
||||
|
||||
type sqlitePieceCompletion struct {
|
||||
mu sync.Mutex
|
||||
closed bool
|
||||
|
|
Loading…
Reference in New Issue