Documentation
¶
Overview ¶
Package sqlite implements the workspace index on a single SQLite file.
Index ¶
- type Option
- type Store
- func (s *Store) Close() error
- func (s *Store) Cursor(ctx context.Context, connector string) (entities.Cursor, error)
- func (s *Store) DeletePendingRefs(ctx context.Context, refs []entities.PendingRef) error
- func (s *Store) DocumentsByID(ctx context.Context, ids []entities.DocID) ([]entities.DocumentMeta, error)
- func (s *Store) DocumentsWithBody(ctx context.Context, ids []entities.DocID) ([]entities.Document, error)
- func (s *Store) HeartbeatLease(ctx context.Context, holder string) error
- func (s *Store) Lease(ctx context.Context) (*entities.LeaseState, error)
- func (s *Store) Meta(ctx context.Context, key string) (string, error)
- func (s *Store) Neighbors(ctx context.Context, ids []entities.DocID, kinds []entities.EdgeKind, ...) ([]entities.Edge, error)
- func (s *Store) PendingRefs(ctx context.Context) ([]entities.PendingRef, error)
- func (s *Store) ReleaseLease(ctx context.Context, holder string) error
- func (s *Store) ReplaceChunks(ctx context.Context, docID entities.DocID, chunks []entities.Chunk) error
- func (s *Store) ResolveRef(ctx context.Context, ref string) ([]entities.DocumentMeta, error)
- func (s *Store) SearchLexical(ctx context.Context, query string, f entities.Filters, k int) ([]entities.ChunkHit, error)
- func (s *Store) SearchVector(ctx context.Context, embedding []float32, f entities.Filters, k int) ([]entities.ChunkHit, error)
- func (s *Store) SetCursor(ctx context.Context, connector string, c entities.Cursor) error
- func (s *Store) SetMeta(ctx context.Context, key, value string) error
- func (s *Store) Stats(ctx context.Context) (entities.IndexStats, error)
- func (s *Store) TryAcquireLease(ctx context.Context, holder string) (bool, error)
- func (s *Store) UpsertDocuments(ctx context.Context, docs []entities.Document) error
- func (s *Store) UpsertEdges(ctx context.Context, edges []entities.Edge) error
- func (s *Store) UpsertPendingRefs(ctx context.Context, refs []entities.PendingRef) error
- func (s *Store) WipeChunks(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func Open ¶
path must already be resolved; no "~" expansion happens here. vectorDims sizes chunk_vectors on a fresh file and is then fixed: reopening with a different width fails, because the vec0 table keeps its original dimensions.
func (*Store) DeletePendingRefs ¶
func (*Store) DocumentsByID ¶
func (s *Store) DocumentsByID(ctx context.Context, ids []entities.DocID) ([]entities.DocumentMeta, error)
The body column is deliberately not read.
func (*Store) DocumentsWithBody ¶
func (*Store) HeartbeatLease ¶
No row updated means the lease was lost, wrapping repositories.ErrLeaseLost.
func (*Store) PendingRefs ¶
func (*Store) ReleaseLease ¶
The holder check is in the statement, so a deferred release after a takeover cannot delete the new holder's lease.
func (*Store) ReplaceChunks ¶
func (s *Store) ReplaceChunks(ctx context.Context, docID entities.DocID, chunks []entities.Chunk) error
chunks_fts and chunk_vectors are keyed by the chunk's rowid, so both derived rows are written with the id SQLite assigned the chunk.
func (*Store) ResolveRef ¶
Every shape the ref could be is queried, because some strings are legitimately two shapes at once — "1234567" is both an abbreviated SHA and an issue number.
func (*Store) SearchLexical ¶
func (*Store) SearchVector ¶
func (*Store) SetMeta ¶
The identity keys are refused: Open validates them against this build, so overwriting one would make the file unopenable.