Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InsertBatched ¶
InsertBatched inserts all rows represented by `data` into `db` in batches of `batchSize` rows. The table must exist.
Types ¶
type Backup ¶
type Backup struct {
// BaseDir can be used for a RESTORE. All paths in the descriptor are
// relative to this.
BaseDir string
Desc sqlccl.BackupDescriptor
// contains filtered or unexported fields
}
Backup is a representation of an enterprise BACKUP.
func (*Backup) NextKeyValues ¶
func (b *Backup) NextKeyValues( count int, newTableID sqlbase.ID, ) ([]engine.MVCCKeyValue, roachpb.Span, error)
NextKeyValues iterates and returns every *user table data* key-value in the backup. At least `count` kvs will be returned, but rows are not broken up, so slightly more than `count` may come back. If fewer than `count` are available, err will be `io.EOF` and kvs may be partially filled with the remainer.
func (*Backup) ResetKeyValueIteration ¶
func (b *Backup) ResetKeyValueIteration()
ResetKeyValueIteration resets the NextKeyValues iteration to the first kv.
type Data ¶
type Data interface {
// Name returns the fully-qualified name of the represented table.
Name() string
// Schema returns the schema for the represented table, such that it can be
// used in fmt.Sprintf(`CREATE TABLE %s %s`, data.Name(), data.Schema`())`.
Schema() string
// NextRow iterates through the rows in the represented table, returning one
// per call. The row is represented as a slice of strings, each string one
// of the columns in the row. When no more rows are available, the bool
// returned is false.
NextRow() ([]string, bool)
// NextRow iterates through the split points in the represented table,
// returning one per call. The split is represented as a slice of strings,
// each string one of the columns in the split. When no more splits are
// available, the bool returned is false.
NextSplit() ([]string, bool)
}
Data is a representation of a sql table, used for creating test data in various forms (sql rows, kvs, enterprise backup). All data tables live in the `data` database.