postgres

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2026 License: AGPL-3.0 Imports: 21 Imported by: 0

Documentation

Overview

Package postgres

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Open added in v0.5.0

func Open(ctx context.Context, dsn string) (*pgxpool.Pool, error)

Types

type Driver

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

func NewDriver

func NewDriver(ctx context.Context, connStr string) (*Driver, error)

func (*Driver) Ancestry added in v0.5.0

func (d *Driver) Ancestry(ctx context.Context, hash string) ([]*merkle.Node, error)

func (*Driver) AncestryChain added in v0.5.0

func (d *Driver) AncestryChain(ctx context.Context, hash string) (*storage.Chain, error)

func (*Driver) AncestryChains added in v0.5.0

func (d *Driver) AncestryChains(ctx context.Context, hashes []string) (map[string]*storage.Chain, error)

func (*Driver) Close added in v0.5.0

func (d *Driver) Close() error

func (*Driver) CountSessions added in v0.5.0

func (d *Driver) CountSessions(ctx context.Context, opts storage.ListOpts) (storage.SessionStats, error)

func (*Driver) DB added in v0.5.0

func (d *Driver) DB() *pgxpool.Pool

func (*Driver) Depth added in v0.5.0

func (d *Driver) Depth(ctx context.Context, hash string) (int, error)

func (*Driver) Get added in v0.5.0

func (d *Driver) Get(ctx context.Context, hash string) (*merkle.Node, error)

func (*Driver) GetByParent added in v0.5.0

func (d *Driver) GetByParent(ctx context.Context, parentHash *string) ([]*merkle.Node, error)

func (*Driver) Has added in v0.5.0

func (d *Driver) Has(ctx context.Context, hash string) (bool, error)

func (*Driver) Leaves added in v0.5.0

func (d *Driver) Leaves(ctx context.Context) ([]*merkle.Node, error)

func (*Driver) List added in v0.5.0

func (d *Driver) List(ctx context.Context) ([]*merkle.Node, error)

func (*Driver) ListParentRefs added in v0.5.0

func (d *Driver) ListParentRefs(ctx context.Context) ([]storage.ParentRef, error)

func (*Driver) ListSessions added in v0.5.0

func (d *Driver) ListSessions(ctx context.Context, opts storage.ListOpts) (*storage.Page[*merkle.Node], error)

func (*Driver) LoadDag added in v0.5.0

func (d *Driver) LoadDag(ctx context.Context, hash string) (*merkle.Dag, error)

func (*Driver) Open added in v0.5.0

func (d *Driver) Open(ctx context.Context) error

func (*Driver) Put added in v0.5.0

func (d *Driver) Put(ctx context.Context, n *merkle.Node) (bool, error)

func (*Driver) Roots added in v0.5.0

func (d *Driver) Roots(ctx context.Context) ([]*merkle.Node, error)

func (*Driver) UpdateUsage added in v0.5.0

func (d *Driver) UpdateUsage(ctx context.Context, hash string, usage *llm.Usage) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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