func (ts *TempSchema) ConnectionPool(params string) (*sqlx.DB, error) {
	return ts.inst.CachedConnectionPool(ts.schemaName, params)
}
ConnectionPool returns a connection pool (*sqlx.DB) to the temporary
workspace schema, using the supplied connection params (which may be blank).
package workspace
import (
	"errors"
	"fmt"
	"github.com/jmoiron/sqlx"
	"github.com/skeema/tengo"
)
type TempSchema struct {
	schemaName  string
	keepSchema  bool
	concurrency int
	skipBinlog  bool
	inst        *tengo.Instance
	releaseLock releaseFunc
}
func NewTempSchema(opts Options) (ts *TempSchema, err error) {
	if opts.Instance == nil {
		return nil, errors.New("No instance defined in options")
	}
	ts = &TempSchema{
		schemaName:  opts.SchemaName,
		keepSchema:  opts.CleanupAction == CleanupActionNone,
		inst:        opts.Instance,
		concurrency: opts.Concurrency,
		skipBinlog:  opts.SkipBinlog,
	}
	lockName := fmt.Sprintf("skeema.%s", ts.schemaName)
	if ts.releaseLock, err = getLock(ts.inst, lockName, opts.LockWaitTimeout); err != nil {
		return nil, fmt.Errorf("Unable to lock temporary schema on %s: %s", ts.inst, err)
	}
	defer func() {
		if err != nil {
			ts.releaseLock()
			ts = nil
		}
	}()
	createOpts := tengo.SchemaCreationOptions{
		DefaultCharSet:   opts.DefaultCharacterSet,
		DefaultCollation: opts.DefaultCollation,
		SkipBinlog:       opts.SkipBinlog,
	}
	if has, err := ts.inst.HasSchema(ts.schemaName); err != nil {
		return ts, fmt.Errorf("Unable to check for existence of temp schema on %s: %s", ts.inst, err)
	} else if has {
		dropOpts := tengo.BulkDropOptions{
			MaxConcurrency:  ts.concurrency,
			OnlyIfEmpty:     true,
			SkipBinlog:      opts.SkipBinlog,
			PartitionsFirst: true,
		}
		if err := ts.inst.DropTablesInSchema(ts.schemaName, dropOpts); err != nil {
			return ts, fmt.Errorf("Cannot drop existing temp schema tables on %s: %s", ts.inst, err)
		}
		if err := ts.inst.DropRoutinesInSchema(ts.schemaName, dropOpts); err != nil {
			return ts, fmt.Errorf("Cannot drop existing temp schema routines on %s: %s", ts.inst, err)
		}
		if err := ts.inst.AlterSchema(ts.schemaName, createOpts); err != nil {
			return ts, fmt.Errorf("Cannot alter existing temp schema charset and collation on %s: %s", ts.inst, err)
		}
	} else {
		_, err = ts.inst.CreateSchema(ts.schemaName, createOpts)
		if err != nil {
			return ts, fmt.Errorf("Cannot create temporary schema on %s: %s", ts.inst, err)
		}
	}
	return ts, nil
}