Documentation
¶
Index ¶
- Constants
- Variables
- func ImportIncremental(ctx context.Context, opts IncrementalImportOptions) (Manifest, ImportPlan, error)
- func WriteManifest(rootDir string, manifest Manifest) error
- type DeleteFunc
- type ExportOptions
- type FileManifest
- type ImportOptions
- type ImportPlan
- type ImportProgress
- type IncrementalImportOptions
- type Manifest
- type RowFilter
- type RowImportFunc
- type Sidecar
- type TableImportMode
- type TableImportPlan
- type TableManifest
Constants ¶
View Source
const ManifestName = "manifest.json"
Variables ¶
View Source
var ErrNoManifest = errors.New("pack manifest not found")
Functions ¶
func ImportIncremental ¶
func ImportIncremental(ctx context.Context, opts IncrementalImportOptions) (Manifest, ImportPlan, error)
func WriteManifest ¶
Types ¶
type ExportOptions ¶
type FileManifest ¶
type ImportOptions ¶
type ImportPlan ¶
type ImportPlan struct {
Full bool
Reason string
Tables []TableImportPlan
}
func PlanIncrementalImport ¶
func PlanIncrementalImport(previous, current Manifest) ImportPlan
func (ImportPlan) Changed ¶
func (p ImportPlan) Changed() bool
type ImportProgress ¶
type IncrementalImportOptions ¶
type IncrementalImportOptions struct {
DB *sql.DB
RootDir string
Previous Manifest
Current Manifest
Plan ImportPlan
DeleteTable DeleteFunc
Filter RowFilter
ImportRow RowImportFunc
Progress func(ImportProgress)
BeforeImport func(context.Context, *sql.Tx) error
AfterImport func(context.Context, *sql.Tx) error
}
type Manifest ¶
type Manifest struct {
Version int `json:"version"`
GeneratedAt time.Time `json:"generated_at"`
Tables []TableManifest `json:"tables"`
Sidecars []Sidecar `json:"sidecars,omitempty"`
Files map[string]string `json:"files,omitempty"`
}
func ReadManifest ¶
type RowImportFunc ¶
type TableImportMode ¶
type TableImportMode string
const ( TableImportSkip TableImportMode = "skip" TableImportReplace TableImportMode = "replace" TableImportFiles TableImportMode = "files" )
type TableImportPlan ¶
type TableImportPlan struct {
Table TableManifest
Mode TableImportMode
Files []FileManifest
Reason string
}
type TableManifest ¶
Click to show internal directories.
Click to hide internal directories.