{"modulePath":"github.com/codepope/cockroach","version":"v0.0.0-20160610015449-872dfdca98e5","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package pgbench\n\n## Functions\n\n```go\nfunc CreateAndConnect(pgURL url.URL, name string) (*gosql.DB, error)\n```\nCreateAndConnect connects and creates the requested DB (dropping if exists) then returns a new connection to the created DB.\n\n```go\nfunc ExecPgbench(pgURL url.URL, dbname string, count int) (*exec.Cmd, error)\n```\nExecPgbench returns a ready-to-run pgbench Cmd, that will run against the db specified by \\`pgURL\\`.\n\n```go\nfunc RunOne(db *gosql.DB, r *rand.Rand, accounts int) error\n```\nRunOne executes one iteration of the query batch that \\`pgbench\\` executes.\n\n```go\nfunc SetupBenchDB(db *gosql.DB, accounts int, quiet bool) error\n```\nSetupBenchDB sets up a db with the schema and initial data used by \\`pgbench\\`. The \\`-i\\` flag to \\`pgbench\\` is usually used to do this when testing postgres but the statements it generates use postgres-specific flags that cockroach does not support. The queries this script runs are based on a dump of a db created by \\`pgbench -i\\`, but sticking to the compatible subset that both cockroach and postgres support.\n\n```go\nfunc SetupExec(pgURL url.URL, name string, accounts, transactions int) (*exec.Cmd, error)\n```\nSetupExec creates and fills a DB and prepares a \\`pgbench\\` command to be run against it.\n\n","path":"github.com/codepope/cockroach/sql/pgbench","name":"pgbench","synopsis":"","isRedistributable":true}
