f99010fae1
CI / lint (push) Failing after 1s
CI / frontend (push) Failing after 1s
CI / scripts (push) Failing after 1s
CI / Go Test (ubuntu-latest) (push) Failing after 0s
CI / frontend-node-25 (push) Failing after 1s
CI / docs (push) Failing after 0s
CI / coverage (push) Failing after 0s
CI / e2e (push) Failing after 0s
Docker / build-and-push (push) Failing after 1s
CI / integration (push) Failing after 4m43s
CI / Go Test (windows-latest) (push) Has been cancelled
CI / Desktop Unit Tests (Windows) (push) Has been cancelled
Desktop Artifacts / Desktop Build (Linux (arm64)) (push) Has been cancelled
Desktop Artifacts / Desktop Build (Linux) (push) Has been cancelled
Desktop Artifacts / Desktop Build (Windows) (push) Has been cancelled
Desktop Artifacts (macOS) / Desktop Build (macOS (aarch64)) (push) Has been cancelled
Desktop Artifacts (macOS) / Desktop Build (macOS (x86_64)) (push) Has been cancelled
29 lines
730 B
Go
29 lines
730 B
Go
//go:build !windows && cgo
|
|
|
|
package vector
|
|
|
|
import (
|
|
"database/sql"
|
|
"fmt"
|
|
"testing"
|
|
|
|
sqlite3 "github.com/mattn/go-sqlite3"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
// setConnVarLimit lowers conn's SQLITE_LIMIT_VARIABLE_NUMBER through the
|
|
// mattn driver's raw-connection API; varlimit_modernc_test.go provides the
|
|
// equivalent for the modernc driver vectors.db uses on Windows or without
|
|
// cgo.
|
|
func setConnVarLimit(t *testing.T, conn *sql.Conn, limit int) {
|
|
t.Helper()
|
|
require.NoError(t, conn.Raw(func(dc any) error {
|
|
sc, ok := dc.(*sqlite3.SQLiteConn)
|
|
if !ok {
|
|
return fmt.Errorf("index conn is %T, want *sqlite3.SQLiteConn", dc)
|
|
}
|
|
sc.SetLimit(sqlite3.SQLITE_LIMIT_VARIABLE_NUMBER, limit)
|
|
return nil
|
|
}))
|
|
}
|