Documentation
¶
Overview ¶
Package teststore opens a store for a test on whichever backend MEMSTORE_TEST_BACKEND names, so the same test file runs against SQLite and PostgreSQL without knowing which it got.
MEMSTORE_TEST_BACKEND=sqlite in-memory SQLite (the default)
MEMSTORE_TEST_BACKEND=pg a private PostgreSQL database per test,
skipped when MEMSTORE_TEST_PG is unset
The daemon runs on PostgreSQL and only on PostgreSQL, so the pg run is the one that says whether the HTTP and MCP layers work; the sqlite run is kept while that backend is still shipped. CI runs both.
Index ¶
Constants ¶
const DefaultUser = "testuser"
DefaultUser is the owner recorded on a PostgreSQL test database. SQLite has no users, so tests that need to name one should use this constant rather than assume.
const VecDim = 4
VecDim is the embedding dimension the store is opened with. The mock embedders in the test packages all produce 4-wide vectors.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Store ¶
type Store interface {
memstore.Store
memstore.StoreScoper
SetReranker(rr embedding.Reranker)
TermDocCounts(ctx context.Context, terms []string) (map[string]int, int, error)
}
Store is what a test may hold: the full store union, the scoper that hands out capability-typed handles, and the two tuning entry points tests reach for that live on both backends but on no capability interface.