mirror of
https://github.com/asg017/sqlite-vec.git
synced 2026-04-25 00:36:56 +02:00
update go ncruces example
This commit is contained in:
parent
18e33edf14
commit
ff30ed3df3
4 changed files with 6 additions and 11 deletions
|
|
@ -1,13 +1,8 @@
|
|||
|
||||
VERSION=0.0.1-alpha.27
|
||||
|
||||
demo: demo.go sqlite3.vec.wasm
|
||||
demo: demo.go
|
||||
go build -o $@ $<
|
||||
|
||||
sqlite3.vec.wasm:
|
||||
curl -L -o $@ https://github.com/asg017/sqlite-vec/releases/download/v$(VERSION)/sqlite-vec-$(VERSION)-ncruces-go.wasm
|
||||
|
||||
clean:
|
||||
rm demo sqlite3.vec.wasm
|
||||
rm demo
|
||||
|
||||
.PHONY: clean
|
||||
|
|
|
|||
|
|
@ -7,11 +7,10 @@ import (
|
|||
"fmt"
|
||||
"log"
|
||||
|
||||
_ "github.com/asg017/sqlite-vec-ncruces-bindings"
|
||||
"github.com/ncruces/go-sqlite3"
|
||||
)
|
||||
|
||||
//go:embed sqlite3.vec.wasm
|
||||
var sqliteWithVecWasm []byte
|
||||
|
||||
func serializeFloat32(vector []float32) ([]byte, error) {
|
||||
buf := new(bytes.Buffer)
|
||||
|
|
@ -24,8 +23,6 @@ func serializeFloat32(vector []float32) ([]byte, error) {
|
|||
|
||||
|
||||
func main() {
|
||||
sqlite3.Binary = sqliteWithVecWasm
|
||||
|
||||
db, err := sqlite3.Open(":memory:")
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ go 1.22.5
|
|||
require github.com/ncruces/go-sqlite3 v0.17.2-0.20240711235451-21de85e849b7
|
||||
|
||||
require (
|
||||
github.com/asg017/sqlite-vec-ncruces-bindings v0.0.1-alpha.33 // indirect
|
||||
github.com/ncruces/julianday v1.0.0 // indirect
|
||||
github.com/tetratelabs/wazero v1.7.3 // indirect
|
||||
golang.org/x/sys v0.22.0 // indirect
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
github.com/asg017/sqlite-vec-ncruces-bindings v0.0.1-alpha.33 h1:Nrzcj5C3Ex64pWvfV6XMgc8KoMfnKoMmibjXJHTdbbY=
|
||||
github.com/asg017/sqlite-vec-ncruces-bindings v0.0.1-alpha.33/go.mod h1:2ji5nzTNgmzsJaKEnxLNRbsMHF17Bv9EbVEf0jQTAyA=
|
||||
github.com/ncruces/go-sqlite3 v0.17.2-0.20240711235451-21de85e849b7 h1:ssM02uUFDfz0V2TMg2du2BjbW9cpOhFJK0kpDN+X768=
|
||||
github.com/ncruces/go-sqlite3 v0.17.2-0.20240711235451-21de85e849b7/go.mod h1:FnCyui8SlDoL0mQZ5dTouNo7s7jXS0kJv9lBt1GlM9w=
|
||||
github.com/ncruces/julianday v1.0.0 h1:fH0OKwa7NWvniGQtxdJRxAgkBMolni2BjDHaWTxqt7M=
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue