csvdata

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const ArtifactKind = "csv-data"
View Source
const ConfigName = "AS.csv.yaml"

Variables

This section is empty.

Functions

func IsConfigPath

func IsConfigPath(name string) bool

Types

type ApplyOptions

type ApplyOptions struct {
	Options
	Artifact    Artifact
	Hash        string
	Acks        []string
	LockTimeout time.Duration
}

type Artifact

type Artifact struct {
	Kind      string              `json:"kind"`
	Version   int                 `json:"version"`
	Schema    string              `json:"schema"`
	Database  string              `json:"database"`
	Target    string              `json:"target"`
	Source    string              `json:"source"`
	Phase     string              `json:"phase,omitempty"`
	Files     []File              `json:"files"`
	Unmatched []string            `json:"unmatched,omitempty"`
	Filters   map[string][]string `json:"filters"`
	Tables    []TablePlan         `json:"tables"`
	Hash      string              `json:"hash"`
}

func Plan

func Plan(ctx context.Context, db *sql.DB, options Options) (_ Artifact, returnErr error)

func (Artifact) Acknowledgements

func (a Artifact) Acknowledgements() []string

func (Artifact) Validate

func (a Artifact) Validate(hash string, acknowledgements []string) error

type Bundle

type Bundle struct {
	Files     []File
	Unmatched []string
	Filters   map[string][]string
	Hash      string
	// contains filtered or unexported fields
}

func Load

func Load(root fs.FS, schema string, filters map[string]string) (Bundle, error)

type File

type File struct {
	Path  string            `json:"path"`
	Table string            `json:"table"`
	Route string            `json:"route"`
	Tags  map[string]string `json:"tags"`
	Hash  string            `json:"hash"`
	// contains filtered or unexported fields
}

type Options

type Options struct {
	Files   fs.FS
	Schema  string
	Filters map[string]string
	Phase   string
}

type Settings

type Settings struct {
	Key           []string      `yaml:"key" json:"key,omitempty"`
	Delimiter     string        `yaml:"delimiter" json:"delimiter,omitempty"`
	IgnoreColumns []string      `yaml:"ignoreColumns" json:"ignoreColumns,omitempty"`
	Phase         string        `yaml:"phase" json:"phase,omitempty"`
	Delete        string        `yaml:"delete" json:"delete,omitempty"`
	Values        ValueSettings `yaml:"values" json:"values"`
}

type TablePlan

type TablePlan struct {
	Table           string `json:"table"`
	Phase           string `json:"phase"`
	Inserts         int    `json:"inserts"`
	Updates         int    `json:"updates"`
	ExplicitDeletes int    `json:"explicitDeletes"`
	SnapshotDeletes int    `json:"snapshotDeletes"`
	Unchanged       int    `json:"unchanged"`
	SchemaHash      string `json:"schemaHash"`
	StateHash       string `json:"stateHash"`
	DeleteHash      string `json:"deleteHash,omitempty"`
}

func Apply

func Apply(ctx context.Context, db *sql.DB, request ApplyOptions) ([]TablePlan, error)

type ValueSettings

type ValueSettings struct {
	Blank         string                   `yaml:"blank" json:"blank,omitempty"`
	NullTokens    []string                 `yaml:"nullTokens" json:"nullTokens,omitempty"`
	NullTokenCase string                   `yaml:"nullTokenCase" json:"nullTokenCase,omitempty"`
	Columns       map[string]ValueSettings `yaml:"columns" json:"columns,omitempty"`
}

Jump to

Keyboard shortcuts

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