dbhash

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2023 License: MIT, Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DatabaseStateHash

func DatabaseStateHash(ctx context.Context, tx *sql.Tx, opts ...Option) (string, error)

DatabaseStateHash calculates the hash of some state of the database according to the options passed.

Types

type Config

type Config struct {
	FetchSchemasQuery string
	PerTableQueryFn   func(string) string
}

Config contains configuration parameters for tableland.

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns the default configuration.

type Option

type Option func(*Config) error

Option modifies a configuration attribute.

func WithFetchSchemasQuery

func WithFetchSchemasQuery(clause string) Option

WithFetchSchemasQuery limits tables that will be used for hash calculation.

func WithPerTableQueryFn

func WithPerTableQueryFn(fn func(tableName string) string) Option

WithPerTableQueryFn defines a function that returns a query for a given table.

Jump to

Keyboard shortcuts

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