postgres

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	URL string
}

type Store

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

Store is a postgres implementation of the schemalog.Store interface

func NewStore

func NewStore(ctx context.Context, cfg Config) (*Store, error)

func NewStoreWithQuerier

func NewStoreWithQuerier(querier pglib.Querier) *Store

func (*Store) Ack

func (s *Store) Ack(ctx context.Context, logEntry *schemalog.LogEntry) error

func (*Store) Close

func (s *Store) Close() error

func (*Store) Fetch

func (s *Store) Fetch(ctx context.Context, schemaName string, version int) (*schemalog.LogEntry, error)

Fetch retrieves the log entry for the schema and version provided.

func (*Store) FetchLast added in v0.4.0

func (s *Store) FetchLast(ctx context.Context, schemaName string, ackedOnly bool) (*schemalog.LogEntry, error)

FetchLast retrieves the latest schema log entry for schemaName. If ackedOnly is set, the function returns the last acked entry. If ackedOnly is NOT set, the function returns the latest entry no matter the acked flag.

func (*Store) Insert added in v0.3.0

func (s *Store) Insert(ctx context.Context, schemaName string) (*schemalog.LogEntry, error)

Insert inserts a new schema log for the schema name on input. It will insert a new row with the latest schema view with an incremented version, or if no row exists for the schema, with version 1.

Jump to

Keyboard shortcuts

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