func (m *Mock) Open(dsn string) (c driver.Conn, err error) {
	m.t.Helper()
	m.conns = make(map[string]*mockConn)
	m.conns["prest"] = &mockConn{}
	c, ok := m.conns[dsn]
	if !ok {
		return c, fmt.Errorf("expected a connection to be available, but it is not")
	}
	return
}
Open makes Mock implement driver.Driver
package mock
import (
	"bytes"
	"database/sql"
	"database/sql/driver"
	"fmt"
	"net/http"
	"net/url"
	"sync"
	"testing"
	"github.com/prest/adapters"
	"github.com/prest/adapters/scanner"
	"github.com/prest/config"
)
type Item struct {
	Body    []byte
	Error   error
	IsCount bool
}
type Mock struct {
	mtx   *sync.RWMutex
	t     *testing.T
	conns map[string]*mockConn
	Items []Item
}
func New(t *testing.T) (m *Mock) {
	m = &Mock{
		mtx: &sync.RWMutex{},
		t:   t,
	}
	drivers := sql.Drivers()
	for _, driver := range drivers {
		if driver == "mock" {
			return
		}
	}
	sql.Register("mock", m)
	return
}