postgres

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBPool

type DBPool interface {
	Exec(ctx context.Context, sql string, arguments ...interface{}) (pgconn.CommandTag, error)
	Query(ctx context.Context, sql string, args ...interface{}) (pgx.Rows, error)
	QueryRow(ctx context.Context, sql string, args ...interface{}) pgx.Row
	Close()
}

DBPool defines the interface for database connection pool

type PostgresCheckpointStore

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

PostgresCheckpointStore implements graph.CheckpointStore using PostgreSQL

func NewPostgresCheckpointStore

func NewPostgresCheckpointStore(ctx context.Context, opts PostgresOptions) (*PostgresCheckpointStore, error)

NewPostgresCheckpointStore creates a new Postgres checkpoint store

func NewPostgresCheckpointStoreWithPool

func NewPostgresCheckpointStoreWithPool(pool DBPool, tableName string) *PostgresCheckpointStore

NewPostgresCheckpointStoreWithPool creates a new Postgres checkpoint store with an existing pool Useful for testing with mocks

func (*PostgresCheckpointStore) Clear

func (s *PostgresCheckpointStore) Clear(ctx context.Context, executionID string) error

Clear removes all checkpoints for an execution

func (*PostgresCheckpointStore) Close

func (s *PostgresCheckpointStore) Close()

Close closes the connection pool

func (*PostgresCheckpointStore) Delete

func (s *PostgresCheckpointStore) Delete(ctx context.Context, checkpointID string) error

Delete removes a checkpoint

func (*PostgresCheckpointStore) InitSchema

func (s *PostgresCheckpointStore) InitSchema(ctx context.Context) error

InitSchema creates the necessary table if it doesn't exist

func (*PostgresCheckpointStore) List

func (s *PostgresCheckpointStore) List(ctx context.Context, executionID string) ([]*graph.Checkpoint, error)

List returns all checkpoints for a given execution

func (*PostgresCheckpointStore) Load

func (s *PostgresCheckpointStore) Load(ctx context.Context, checkpointID string) (*graph.Checkpoint, error)

Load retrieves a checkpoint by ID

func (*PostgresCheckpointStore) Save

func (s *PostgresCheckpointStore) Save(ctx context.Context, checkpoint *graph.Checkpoint) error

Save stores a checkpoint

type PostgresOptions

type PostgresOptions struct {
	ConnString string
	TableName  string // Default "checkpoints"
}

PostgresOptions configuration for Postgres connection

Jump to

Keyboard shortcuts

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