Help us shape the future of Go! Take the 2026 Go Developer Survey

postgres

package
v0.0.0-...-94a2dde Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package postgres implements the standard Python-schema-compatible PostgreSQL saver.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MigrationStatements

func MigrationStatements() []string

MigrationStatements returns a defensive copy for schema conformance tests.

Types

type Codec

type Codec = serde.Codec

Codec is the checkpoint payload codec accepted by NewWithCodec.

type Saver

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

Saver owns or wraps a database/sql PostgreSQL pool.

func New

func New(database *sql.DB) *Saver

New wraps an existing database/sql PostgreSQL handle with the safe default codec.

func NewWithCodec

func NewWithCodec(database *sql.DB, payloadCodec Codec) *Saver

NewWithCodec wraps an existing database/sql PostgreSQL handle with payloadCodec.

func Open

func Open(dsn string) (*Saver, error)

func (*Saver) Close

func (saver *Saver) Close() error

func (*Saver) CopyThread

func (saver *Saver) CopyThread(ctx context.Context, sourceThreadID, targetThreadID string) error

func (*Saver) DeleteThread

func (saver *Saver) DeleteThread(ctx context.Context, threadID string) error

func (*Saver) GetDeltaChannelHistory

func (saver *Saver) GetDeltaChannelHistory(ctx context.Context, config dacheckpoint.Config, channels []string) (map[string]dacheckpoint.DeltaHistory, error)

func (*Saver) GetTuple

func (saver *Saver) GetTuple(ctx context.Context, config dacheckpoint.Config) (*dacheckpoint.Tuple, error)

func (*Saver) List

func (saver *Saver) List(ctx context.Context, config *dacheckpoint.Config, options dacheckpoint.ListOptions) ([]dacheckpoint.Tuple, error)

func (*Saver) NextVersion

func (saver *Saver) NextVersion(current string) (string, error)

func (*Saver) Prune

func (saver *Saver) Prune(ctx context.Context, threadIDs []string, strategy dacheckpoint.PruneStrategy) error

func (*Saver) Put

func (saver *Saver) Put(
	ctx context.Context,
	config dacheckpoint.Config,
	value dacheckpoint.Checkpoint,
	metadata dacheckpoint.Metadata,
	newVersions map[string]string,
) (dacheckpoint.Config, error)

func (*Saver) PutWrites

func (saver *Saver) PutWrites(
	ctx context.Context,
	config dacheckpoint.Config,
	taskID string,
	taskPath string,
	writes []dacheckpoint.ChannelWrite,
) error

func (*Saver) Setup

func (saver *Saver) Setup(ctx context.Context) error

Jump to

Keyboard shortcuts

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