func integrationOpen(t *testing.T, dsn ...string) *sql.DB {
	target := integrationServerDSN(t)
	if len(dsn) > 0 {
		target = dsn[0]
	}
	db, err := sql.Open("presto", target)
	if err != nil {
		t.Fatal(err)
	}
	return db
}
integrationOpen opens a connection to the integration test server.
package presto
import (
	"context"
	"database/sql"
	"errors"
	"flag"
	"os"
	"strings"
	"testing"
	"time"
)
var (
	integrationServerFlag = flag.String(
		"presto_server_dsn",
		os.Getenv("PRESTO_SERVER_DSN"),
		"dsn of the presto server used for integration tests; default disabled",
	)
	integrationServerQueryTimeout = flag.Duration(
		"presto_query_timeout",
		5*time.Second,
		"max duration for presto queries to run before giving up",
	)
)
func init() {
	flag.Parse()
	DefaultQueryTimeout = *integrationServerQueryTimeout
	DefaultCancelQueryTimeout = *integrationServerQueryTimeout
}
func integrationServerDSN(t *testing.T) string {
	if dsn := *integrationServerFlag; dsn != "" {
		return dsn
	}
	t.Skip()
	return ""
}