sqldb: exclude sqlite from the JS and unsupported platform builds

This commit is contained in:
Andras Banki-Horvath
2023-12-06 19:47:56 +01:00
parent 88370de1ab
commit ce1b57da2d
7 changed files with 198 additions and 83 deletions

18
sqldb/no_sqlite.go Normal file
View File

@@ -0,0 +1,18 @@
//go:build js || (windows && (arm || 386)) || (linux && (ppc64 || mips || mipsle || mips64))
package sqldb
import "fmt"
// SqliteStore is a database store implementation that uses a sqlite backend.
type SqliteStore struct {
cfg *SqliteConfig
*BaseDB
}
// NewSqliteStore attempts to open a new sqlite database based on the passed
// config.
func NewSqliteStore(cfg *SqliteConfig, dbPath string) (*SqliteStore, error) {
return nil, fmt.Errorf("SQLite backend not supported in WebAssembly")
}