postgres

package
v0.0.0-...-6e95bb6 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateDocsParams

type CreateDocsParams struct {
	Path      string
	Content   []byte
	Embedding pgvector.Vector
}

type DBTX

type DBTX interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
}

type Doc

type Doc struct {
	ID        pgtype.UUID
	Path      string
	Content   []byte
	Embedding pgvector.Vector
}

type FindTopDocsByEmbeddingRow

type FindTopDocsByEmbeddingRow struct {
	Path    string
	Content []byte
}

type Queries

type Queries struct {
	// contains filtered or unexported fields
}

func New

func New(db DBTX) *Queries

func (*Queries) CreateDocs

func (q *Queries) CreateDocs(ctx context.Context, arg CreateDocsParams) error

func (*Queries) FindTopDocsByEmbedding

func (q *Queries) FindTopDocsByEmbedding(ctx context.Context, dollar_1 pgvector.Vector) ([]FindTopDocsByEmbeddingRow, error)

func (*Queries) HasDoc

func (q *Queries) HasDoc(ctx context.Context, path string) (bool, error)

func (*Queries) WithTx

func (q *Queries) WithTx(tx pgx.Tx) *Queries

type Store

type Store struct {
	*Queries
	// contains filtered or unexported fields
}

func NewStore

func NewStore(ctx context.Context, databaseURL string) (*Store, error)

func (*Store) Close

func (s *Store) Close(ctx context.Context) error

Jump to

Keyboard shortcuts

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