Documentation
¶
Overview ¶
Package scripts owns migration source identity, dependencies and consumed fingerprints.
Index ¶
- func Digest(fields ...string) string
- func InputHash(inputs map[string]string) string
- func QuoteName(name string) (string, error)
- func SourceHash(content string) string
- type Analysis
- type AnalysisOptions
- type Dependency
- type LoadOptions
- type Observation
- type Pending
- type Phase
- type Plan
- type PlanOptions
- type Scalar
- type Script
- type State
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SourceHash ¶
Types ¶
type Analysis ¶
type Analysis struct {
Calls []string `json:"calls"`
Builtins []sqlglot.BuiltinFunction `json:"builtins,omitempty"`
Blocked []string `json:"blocked,omitempty"`
Unresolved []string `json:"unresolved,omitempty"`
TransactionControl bool `json:"transactionControl,omitempty"`
}
func Analyze ¶
func Analyze(opts AnalysisOptions) Analysis
Analyze visits executable expressions, leaving stored module bodies for catalog analysis.
type AnalysisOptions ¶
type Dependency ¶
type Observation ¶
type Plan ¶
type Plan struct {
Target string `json:"target"`
Phase Phase `json:"phase"`
Hash string `json:"hash"`
Scripts []Pending `json:"scripts"`
}
func Build ¶
func Build(opts PlanOptions) (Plan, error)
type PlanOptions ¶
type Scalar ¶
type Script ¶
type Script struct {
ID string `json:"id"`
Path string `json:"path"`
Name string `json:"name"`
SQL string `json:"sql"`
Phase Phase `json:"phase"`
HeaderPhase Phase `json:"-"`
Always bool `json:"always,omitempty"`
NonTransactional bool `json:"nonTransactional,omitempty"`
DependsOn []string `json:"dependsOn,omitempty"`
Dependencies []Dependency `json:"dependencies,omitempty"`
ExplicitDependencies bool `json:"explicitDependencies,omitempty"`
ContextPolicy string `json:"contextPolicy,omitempty"`
}
func Load ¶
func Load(opts LoadOptions) ([]Script, error)
type State ¶
type State struct {
Version int `json:"version"`
SourceHash string `json:"sourceHash"`
PolicyHash string `json:"policyHash"`
Hash string `json:"hash"`
Inputs map[string]string `json:"inputs"`
Outcome string `json:"outcome,omitempty"`
EvidenceHash string `json:"evidenceHash,omitempty"`
Provenance string `json:"provenance,omitempty"`
LastSuccess *State `json:"lastSuccess,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.