Documentation
¶
Overview ¶
Package reset drops every table in a database, including the migration ledger.
It is a separate package because it is destructive and because most programs have no business importing it. It exists to support a "start from nothing" command in a development or test environment.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrUnsupported = errors.New("dialect does not support reset")
ErrUnsupported reports a dialect that does not implement Resetter.
Functions ¶
Types ¶
type Resetter ¶
type Resetter interface {
// ListTablesQuery selects the names of every table in the connected
// database or current schema, as a single column.
ListTablesQuery() string
// QuoteIdentifier quotes a table name for interpolation.
QuoteIdentifier(name string) string
// DropTablesStatement drops every already-quoted table named.
DropTablesStatement(quoted []string) string
}
Resetter is the part of a dialect needed to drop a schema. A rung.Dialect that does not implement it cannot be reset by this package.
It is a separate, optional interface rather than part of rung.Dialect so that implementing a dialect does not oblige anyone to implement a destructive operation.
Click to show internal directories.
Click to hide internal directories.