Documentation
¶
Overview ¶
Package preset knows the schemas of common platforms: where they keep personal data, how their tables link up, and which settings would let a staging copy act on real customers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Names = []string{"wordpress", "woocommerce", "magento2", "laravel"}
Names lists the presets that can be asked for by name.
Functions ¶
Types ¶
type MetaTable ¶
type MetaTable struct {
Key, Value string
Platform string
Keys map[string]*detect.Hint // known keys
Probe []string // keys worth reading directly if the sample misses them
HintFor func(key string) *detect.Hint // pattern-based hints
Label func(key string) string // maps raw keys to names, e.g. Magento attribute IDs
}
MetaTable describes a key/value table such as wp_postmeta. Each key is judged on its own, as if it were a column.
type Querier ¶
type Querier interface {
QueryContext(ctx context.Context, query string, args ...any) (*sql.Rows, error)
QueryRowContext(ctx context.Context, query string, args ...any) *sql.Row
}
Querier is the part of *sql.DB the presets need.
type Result ¶
type Result struct {
Platforms []model.Platform
Columns map[string]map[string]*detect.Hint // table → lower-case column → hint
Meta map[string]*MetaTable
Actions map[string]TableAction
Relationships []model.Relationship
Prefixes []string
SideEffects []model.SideEffect
Warnings []string
}
Result is everything the presets found.
type TableAction ¶
TableAction is advice for a whole table, e.g. to empty it in the copy.
Click to show internal directories.
Click to hide internal directories.