postgres

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package postgres provides PostgreSQL storage implementation for CVT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PostgresStore

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

PostgresStore implements storage.Store using PostgreSQL.

func New

func New(ctx context.Context, cfg storage.Config) (*PostgresStore, error)

New creates a new PostgreSQL store.

func (*PostgresStore) Close

func (s *PostgresStore) Close() error

Close closes the database connection pool.

func (*PostgresStore) DeleteSchema

func (s *PostgresStore) DeleteSchema(ctx context.Context, schemaID string) error

DeleteSchema removes all versions of a schema.

func (*PostgresStore) DeleteSchemaVersion

func (s *PostgresStore) DeleteSchemaVersion(ctx context.Context, schemaID, version string) error

DeleteSchemaVersion removes a specific version of a schema.

func (*PostgresStore) DeregisterConsumer

func (s *PostgresStore) DeregisterConsumer(ctx context.Context, consumerID, schemaID, environment string) error

DeregisterConsumer removes a consumer registration.

func (*PostgresStore) GetComparison

func (s *PostgresStore) GetComparison(ctx context.Context, schemaID, oldVersion, newVersion string) (*storage.ComparisonRecord, error)

GetComparison retrieves a stored comparison.

func (*PostgresStore) GetConsumer

func (s *PostgresStore) GetConsumer(ctx context.Context, consumerID, schemaID, environment string) (*storage.ConsumerRecord, error)

GetConsumer retrieves a consumer registration.

func (*PostgresStore) GetPreviousVersion

func (s *PostgresStore) GetPreviousVersion(ctx context.Context, schemaID, currentVersion string) (string, error)

GetPreviousVersion returns the version before the current one.

func (*PostgresStore) GetSchema

func (s *PostgresStore) GetSchema(ctx context.Context, schemaID string) (*storage.SchemaRecord, error)

GetSchema retrieves the latest version of a schema.

func (*PostgresStore) GetSchemaVersion

func (s *PostgresStore) GetSchemaVersion(ctx context.Context, schemaID, version string) (*storage.SchemaRecord, error)

GetSchemaVersion retrieves a specific version of a schema.

func (*PostgresStore) GetValidationAnalytics

func (s *PostgresStore) GetValidationAnalytics(ctx context.Context, filter storage.ListValidationsFilter) (*storage.ValidationAnalytics, error)

GetValidationAnalytics returns aggregated validation statistics.

func (*PostgresStore) ListConsumers

ListConsumers returns consumers matching the filter.

func (*PostgresStore) ListSchemaIDs

func (s *PostgresStore) ListSchemaIDs(ctx context.Context) ([]string, error)

ListSchemaIDs returns all unique schema IDs.

func (*PostgresStore) ListSchemas

ListSchemas returns schemas matching the filter.

func (*PostgresStore) ListValidations

ListValidations returns validation runs matching the filter.

func (*PostgresStore) ListVersions

func (s *PostgresStore) ListVersions(ctx context.Context, schemaID string) ([]string, error)

ListVersions returns all versions of a schema.

func (*PostgresStore) Migrate

func (s *PostgresStore) Migrate(ctx context.Context) error

Migrate runs database migrations.

func (*PostgresStore) Ping

func (s *PostgresStore) Ping(ctx context.Context) error

Ping verifies database connectivity.

func (*PostgresStore) RecordComparison

func (s *PostgresStore) RecordComparison(ctx context.Context, record *storage.ComparisonRecord) error

RecordComparison stores a schema comparison.

func (*PostgresStore) RecordValidation

func (s *PostgresStore) RecordValidation(ctx context.Context, record *storage.ValidationRecord) error

RecordValidation stores a validation run.

func (*PostgresStore) RegisterConsumer

func (s *PostgresStore) RegisterConsumer(ctx context.Context, record *storage.ConsumerRecord) error

RegisterConsumer stores or updates a consumer registration.

func (*PostgresStore) SetSchema

func (s *PostgresStore) SetSchema(ctx context.Context, record *storage.SchemaRecord) error

SetSchema stores or updates a schema record.

func (*PostgresStore) UpdateConsumerValidation

func (s *PostgresStore) UpdateConsumerValidation(ctx context.Context, consumerID, schemaID, environment string, validatedAt time.Time) error

UpdateConsumerValidation updates the last validated timestamp for a consumer.

Jump to

Keyboard shortcuts

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