Documentation
¶
Overview ¶
Package dbengine describes how each supported engine is probed, dumped and restored. Every argv runs inside the database container through `docker compose exec -T`, wrapped in `sh -c` where a credential must expand there.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsFileBased ¶
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.
// Only postgres restores extras; config validation keeps them off the rest.
RestoreScript(project string, extras []string) string
}