data_load

package
v1.56.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 3, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Archives = map[string]DataDefinition{
	"world": {
		Description:       "world database",
		Origin:            "https://downloads.mysql.com/docs/world.sql.gz",
		FileName:          "world.sql.gz",
		InternalDirectory: "",
		LoadCommands:      []string{"$use < world.sql"},
		Size:              92707,
		Sha256:            "",
	},
	"worldx": {
		Description:       "world_X database",
		Origin:            "https://downloads.mysql.com/docs/world_x-db.tar.gz",
		FileName:          "world_x-db.tar.gz",
		InternalDirectory: "world_x-db",
		LoadCommands:      []string{"$use < world_x-db/world_x.sql"},
		Size:              99295,
		Sha256:            "7fcdf77481e069575220f573600a553d8e6bea93984c6022edae163e3270dfb7",
	},
	"sakila": {
		Description:       "Sakila database",
		Origin:            "https://downloads.mysql.com/docs/sakila-db.tar.gz",
		FileName:          "sakila-db.tar.gz",
		InternalDirectory: "sakila-db",
		LoadCommands: []string{
			"$use < sakila-db/sakila-schema.sql",
			"$use < sakila-db/sakila-data.sql",
		},
		Size:   732126,
		Sha256: "9152dd031cf8d95eba8f6f4340117641894874268df6216a6dfc159ea9115a20",
	},
	"employees": {
		Description:       "employee data (large dataset, includes data and test/verification suite)",
		Origin:            "https://github.com/datacharmer/test_db/releases/download/v1.0.7/test_db-1.0.7.tar.gz",
		FileName:          "test_db-1.0.7.tar.gz",
		InternalDirectory: "test_db",
		ChangeDirectory:   true,
		LoadCommands: []string{
			"$use < employees.sql",
		},
		Size:   35607473,
		Sha256: "c44c140f352f35d47fdb65df60f52b779ef552822fad6c4efcfa7b134c3faf84",
	},
	"menagerie": {
		Description:       "menagerie database",
		Origin:            "https://downloads.mysql.com/docs/menagerie-db.tar.gz",
		FileName:          "menagerie-db.tar.gz",
		InternalDirectory: "menagerie-db",
		LoadCommands: []string{
			"$use -e 'create database if not exists menagerie'",
			"$use menagerie < menagerie-db/cr_pet_tbl.sql",
			"$use menagerie < menagerie-db/cr_event_tbl.sql",
			"$use menagerie < menagerie-db/ins_puff_rec.sql",
			"$use menagerie -e 'set global local_infile=ON'",
			"$my sqlimport --local menagerie menagerie-db/pet.txt",
			"$my sqlimport --local menagerie menagerie-db/event.txt",
		},
		Size:   1990,
		Sha256: "f330902364d82431ad88aff1e8ad5e27fd7fc61d4722c86e9e9b86f7969e49c4",
	},
}

Functions

func ArchivesAsJson

func ArchivesAsJson() (string, error)

func ListArchives

func ListArchives()

func LoadArchive

func LoadArchive(archiveName, sandboxName string, overwrite bool) error

Types

type DataDefinition

type DataDefinition struct {
	Description       string   `json:"description,omitempty"`        // Description of the database
	Origin            string   `json:"origin"`                       // [Required] Where is the archive
	FileName          string   `json:"file_name"`                    // [Required] File name that we will get locally
	InternalDirectory string   `json:"internal-directory,omitempty"` // Optional internal directory of the archive
	ChangeDirectory   bool     `json:"change-dir,omitempty"`         // Whether we need to operate within the internal directory
	LoadCommands      []string `json:"load-commands"`                // [Required] Set of commands used to load the archive
	Size              uint64   `json:"size,omitempty"`               // Size of original archive
	Sha256            string   `json:"sha256,omitempty`              // SHA 256 checksum of the compressed archive
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL