graphqlstore

package
v1.131.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 13, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

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

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 New

func New(db *sql.DB) *Store

New builds a store over the platform's database handle.

func (*Store) DeleteSchema

func (s *Store) DeleteSchema(ctx context.Context, connection string) error

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL