package module
Version: v0.0.0-...-c3e8d98 Latest Latest

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

Go to latest
Published: Nov 15, 2014 License: BSD-3-Clause Imports: 14 Imported by: 0




Package mysqltest provides standalone test instances of mysql sutable for use in tests.



This section is empty.


This section is empty.


This section is empty.


type Fatalf

type Fatalf interface {
	Fatalf(format string, args ...interface{})

Fatalf is satisfied by testing.T or testing.B.

type Server

type Server struct {
	Port    int
	DataDir string
	Socket  string
	T       Fatalf
	// contains filtered or unexported fields

Server is a unique instance of a mysqld.

func NewServerDB

func NewServerDB(t Fatalf, db string) (*Server, *sql.DB)

NewServerDB creates a new server, starts it, creates the named DB, and returns both.

func NewStartedServer

func NewStartedServer(t Fatalf) *Server

NewStartedServer creates a new server starts it.

func (*Server) DB

func (s *Server) DB(suffix string) *sql.DB

DB for the server. The suffix is in the form "dbname?param=value".

func (*Server) DSN

func (s *Server) DSN(suffix string) string

DSN for the mysql server, suitable for use with sql.Open. The suffix is in the form "dbname?param=value".

func (*Server) Start

func (s *Server) Start()

Start the server, this will return once the server has been started.

func (*Server) Stop

func (s *Server) Stop()

Stop the server, this will also remove all data.

Source Files

Jump to

Keyboard shortcuts

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