Documentation
¶
Overview ¶
Package dbengine describes how each supported database engine is probed, dumped and restored. Every argv it returns runs inside the database container through `docker compose exec -T <service> ...`; engines needing the container's own variables wrap the command in `sh -c` so credentials expand in the container and never appear in wtm's arguments.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsFileBased ¶
IsFileBased reports whether name designates an engine whose snapshot is a plain file rather than a server dump.
func Names ¶
func Names() []string
Names lists the supported engines, for validation and completion.
func TempDBName ¶
TempDBName keeps the throwaway database identifier valid unquoted in every engine: my-app would not be.
Types ¶
type Engine ¶
type Engine interface {
Name() string
// DetectImage reports whether this engine runs the given image repo
// (already lowercased and stripped of tag and digest).
DetectImage(repo string) bool
// ReadyArgs succeeds once the server accepts connections.
ReadyArgs(user string) []string
DropTempDBArgs(user, db string) []string
// CreateTempDBArgs is nil for engines creating databases implicitly.
CreateTempDBArgs(user, db string) []string
// DumpArgs writes the dump of db to stdout.
DumpArgs(user, db string) []string
// ObjectCountArgs writes to stdout how many tables, or collections, db
// holds. A migration that never targeted the throwaway database leaves it
// at zero, which is the only way to tell that dump from a real one.
ObjectCountArgs(user, db string) []string
// RestoreScript is the docker-entrypoint-initdb.d body restoring the dump.
RestoreScript(project string) string
}
Engine is one supported database engine.