postgres

package
v0.14.5 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMigrationsFS added in v0.6.0

func GetMigrationsFS() (fs.FS, error)

func Migrations

func Migrations() *persistence.Migrations

Types

type BunDB

type BunDB interface {
	NewInsert() *bun.InsertQuery
	NewSelect() *bun.SelectQuery
	NewDelete() *bun.DeleteQuery
	NewRaw(query string, args ...any) *bun.RawQuery
	PingContext(ctx context.Context) error
	RunInTx(ctx context.Context, opts *sql.TxOptions, fn func(ctx context.Context, tx bun.Tx) error) error
}

type Config

type Config struct {
	DB                      BunDB
	TableName               string
	SearchConfig            string
	TrigramThreshold        float64
	SuggestTrigramThreshold float64
	SchemaManagement        SchemaManagementMode
	Clock                   types.Clock
	Limits                  types.RequestLimits
	MaxScanRows             int
}

type Provider

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

func New

func New(cfg Config) (*Provider, error)

func (*Provider) Capabilities

func (p *Provider) Capabilities(context.Context) (types.CapabilitySet, error)

func (*Provider) DeleteBySource

func (p *Provider) DeleteBySource(ctx context.Context, index, registrationKey string, sourceIDs []string) error

func (*Provider) DeleteDocuments

func (p *Provider) DeleteDocuments(ctx context.Context, index string, ids []string) error

func (*Provider) EnsureIndex

func (p *Provider) EnsureIndex(ctx context.Context, def types.IndexDefinition) error

func (*Provider) Health

func (*Provider) Name

func (p *Provider) Name() string

func (*Provider) ReplaceDocuments

func (p *Provider) ReplaceDocuments(ctx context.Context, index, registrationKey string, sourceIDs []string, docs []types.Document) error

func (*Provider) ResetRegistration added in v0.2.0

func (p *Provider) ResetRegistration(ctx context.Context, index, registrationKey string) error

func (*Provider) Search

func (*Provider) SearchBatch

func (p *Provider) SearchBatch(ctx context.Context, requests []types.SearchRequest) ([]types.SearchResultPage, error)

func (*Provider) Suggest

func (*Provider) UpsertDocuments

func (p *Provider) UpsertDocuments(ctx context.Context, index string, docs []types.Document) error

type SchemaManagementMode added in v0.6.0

type SchemaManagementMode string
const (
	SchemaManagementAuto     SchemaManagementMode = "auto"
	SchemaManagementExternal SchemaManagementMode = "external"
)

Jump to

Keyboard shortcuts

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