Documentation
¶
Index ¶
- type DBPool
- type PostgresCheckpointStore
- func (s *PostgresCheckpointStore) Clear(ctx context.Context, executionID string) error
- func (s *PostgresCheckpointStore) Close()
- func (s *PostgresCheckpointStore) Delete(ctx context.Context, checkpointID string) error
- func (s *PostgresCheckpointStore) InitSchema(ctx context.Context) error
- func (s *PostgresCheckpointStore) List(ctx context.Context, executionID string) ([]*graph.Checkpoint, error)
- func (s *PostgresCheckpointStore) Load(ctx context.Context, checkpointID string) (*graph.Checkpoint, error)
- func (s *PostgresCheckpointStore) Save(ctx context.Context, checkpoint *graph.Checkpoint) error
- type PostgresOptions
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 ¶
PostgresOptions configuration for Postgres connection