apply

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2024 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Overview

Package apply contains code for applying mutations to tables.

Index

Constants

View Source
const (
	// QueryDir is the name of the subdirectory in the template [fs.FS].
	QueryDir = "queries"

	// TemplateOverrideEnv is the name of an environment variable that
	// overrides the [fs.FS] from which the query templates are loaded.
	// This facilitates ad-hoc debugging of queries, without the need to
	// recompile the Replicator binary.
	TemplateOverrideEnv = "REPLICATOR_TEMPLATES"
)

Variables

View Source
var (
	// EmbeddedTemplates bundles the templates into the binary.
	//go:embed queries/*/*.tmpl
	EmbeddedTemplates embed.FS
)

Set is used by Wire.

Functions

func IsMergeSupported

func IsMergeSupported(product types.Product) bool

IsMergeSupported returns true if the applier supports three-way merges for the given product.

Work items in https://github.com/cockroachdb/replicator/issues/487

Types

type Acceptor

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

Acceptor writes batches of mutations into their target tables.

func ProvideAcceptor

func ProvideAcceptor(
	ctx *stopper.Context,
	cache *types.TargetStatements,
	configs *applycfg.Configs,
	diags *diag.Diagnostics,
	dlqs types.DLQs,
	target *types.TargetPool,
	watchers types.Watchers,
) (*Acceptor, error)

ProvideAcceptor is called by Wire.

func (*Acceptor) AcceptTableBatch

func (a *Acceptor) AcceptTableBatch(
	ctx context.Context, batch *types.TableBatch, opts *types.AcceptOptions,
) error

AcceptTableBatch implements types.TableAcceptor. If the options do not provide a types.TargetQuerier, the types.TargetPool will be used instead.

Jump to

Keyboard shortcuts

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