Documentation
¶
Overview ¶
Package graphqlstore is the PostgreSQL persistence behind the platform's graphql connection kind: the schema each connection was last read with, and the per-operation embedding vectors that ranking scores against.
It is the concrete for two contracts the toolkit declares (graphql.SchemaStore and graphql.VectorReader) plus the vector writes the index-jobs consumer performs. Keeping it here rather than under pkg/ is what keeps the toolkit free of a database dependency: a deployment with no database still registers graphql connections, introspects them at startup, and ranks them lexically.
Index ¶
- type Store
- func (s *Store) DeleteSchema(ctx context.Context, connection string) error
- func (s *Store) GetSchema(ctx context.Context, connection string) (graphqlkit.StoredSchema, error)
- func (s *Store) LoadVectors(ctx context.Context, connection, schemaHash string) (map[string][]float32, error)
- func (s *Store) PutSchema(ctx context.Context, schema graphqlkit.StoredSchema) error
- func (s *Store) RecordReadError(ctx context.Context, schema graphqlkit.StoredSchema) error
- func (s *Store) SchemaVersion(ctx context.Context, connection string) (graphqlkit.StoredSchema, 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
}
Store persists graphql schemas and operation embeddings.
func (*Store) DeleteSchema ¶
DeleteSchema removes a connection's schema and every embedding built from it. A connection that is gone must not leave an index behind for a later connection of the same name to inherit.
func (*Store) GetSchema ¶
func (s *Store) GetSchema(ctx context.Context, connection string) (graphqlkit.StoredSchema, error)
GetSchema returns a connection's stored schema.
func (*Store) LoadVectors ¶
func (s *Store) LoadVectors(ctx context.Context, connection, schemaHash string) (map[string][]float32, error)
LoadVectors returns the persisted embeddings for one connection's schema version, keyed by operation id.
func (*Store) PutSchema ¶
func (s *Store) PutSchema(ctx context.Context, schema graphqlkit.StoredSchema) error
PutSchema writes a connection's schema, replacing any previous one.
func (*Store) RecordReadError ¶ added in v1.131.3
func (s *Store) RecordReadError(ctx context.Context, schema graphqlkit.StoredSchema) error
RecordReadError records a refused read beside the connection's stored schema, leaving the schema itself untouched. The row is updated only while it still holds the version the reader held, so a read that raced an upload records nothing.
func (*Store) SchemaVersion ¶ added in v1.131.3
func (s *Store) SchemaVersion(ctx context.Context, connection string) (graphqlkit.StoredSchema, error)
SchemaVersion returns a connection's stored schema version without its SDL: the columns a replica compares with what it holds.