postgres

package
v0.0.0-...-d85aa1e Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Storage

type Storage struct {
	Pool *pgx.ConnPool
	// contains filtered or unexported fields
}

Storage implements a Postgresql backed storage layer, suitable for use with the verifiabledatastructures library.

func (*Storage) ExecuteReadOnly

func (pgs *Storage) ExecuteReadOnly(ctx context.Context, namespace []byte, f func(ctx context.Context, db verifiable.KeyReader) error) error

ExecuteReadOnly executes a read only query. Note this will have the side-effect of creating a table for this namespace, if it doesn't already exist.

func (*Storage) ExecuteUpdate

func (pgs *Storage) ExecuteUpdate(ctx context.Context, namespace []byte, f func(ctx context.Context, db verifiable.KeyWriter) error) error

ExecuteUpdate executes an update query. Only one of these can execute per-namespace at once, and this is enforced by a full table lock.

Jump to

Keyboard shortcuts

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