Documentation ¶
Overview ¶
Package applycfg contains code for persisting applier configurations. This is separate from apply since we use the staging database as the storage location.
Index ¶
Constants ¶
const DefaultRowLimit = 100
DefaultRowLimit limits the number of rows to be sent in a single statement for targets that do not have a bulk-transfer mechanism. If the target doesn't have a bulk-transfer method, then the generated SQL depends on the number of rows being sent, i.e. a bind variable per column per row. This flush size will place an upper bound on the length of the generated SQL and may need to be tuned for hyper-wide tables.
const SubstitutionToken = "$0"
SubstitutionToken contains the string that we'll use to substitute in the actual parameter index into the generated SQL.
Variables ¶
var Set = wire.NewSet( ProvideConfigs, )
Set is used by Wire.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // NB: Update TestCopyEquals if adding new fields. CASColumns TargetColumns // The columns for compare-and-set operations. Deadlines *ident.Map[time.Duration] // Deadline-based operation. Exprs *ident.Map[string] // Synthetic or replacement SQL expressions. Extras TargetColumn // JSONB column to store unmapped values in. Ignore *ident.Map[bool] // Source column names to ignore. Merger merge.Merger // Conflict resolution. RowLimit int // Adjust if hitting limits on bind variables. SourceNames *ident.Map[SourceColumn] // Look for alternate name in the incoming data. }
A Config contains per-target-table configuration.
func NewConfig ¶
func NewConfig() *Config
NewConfig constructs a Config with all map fields populated.
func (*Config) Equal ¶
Equal returns true if the other Config is equivalent to the receiver.
This method is intended for testing only. It does not compare the callback fields, since not all implementations of those interfaces are guaranteed to have a defined comparison operation (e.g. merge.Func).
type Configs ¶
type Configs struct {
// contains filtered or unexported fields
}
Configs provides a lookup service for per-destination-table configurations.
func ProvideConfigs ¶
func ProvideConfigs(diags *diag.Diagnostics) (*Configs, error)
ProvideConfigs is called by Wire to construct a Configs instance.
func (*Configs) Diagnostic ¶
Diagnostic implements diag.Diagnostic.
type SourceColumn ¶
SourceColumn is the name of a column found in incoming data.
type SourceColumns ¶
SourceColumns is the names of columns found in the source database.
type TargetColumn ¶
TargetColumn is the name of a column found in the target database.
type TargetColumns ¶
TargetColumns is the names of columns found in the target database.