dbtest

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package dbtest implements database test functions.

Index

Constants

This section is empty.

Variables

View Source
var DropSchema = flag.Bool("dropschema", true, "drop test schema if test ran successfully")

DropSchema will drop the test schema after execution. if set to true (default), the test schema will be dropped after successful test execution. if set to false, the test schema will remain on database after test execution.

View Source
var DropSchemas = flag.Bool("dropschemas", false, "drop all existing test schemas if test ran successfully")

DropSchemas will drop all schemas with GoHDBTestSchemaPrefix prefix to clean-up all not yet deleted test schemas created by go-hdb unit tests.

View Source
var Schema = flag.String("schema", testGoHDBSchemaPrefix+rand.AlphanumString(16), "database schema")

Schema defines the database schema where test tables are going to be created.

Functions

func LogDriverStats

func LogDriverStats(driverStats any) error

LogDriverStats outputs the driver statistics.

func QueryInvalidConnectAttempts

func QueryInvalidConnectAttempts(db *sql.DB, username string) int64

QueryInvalidConnectAttempts returns the number of invalid connection attempts.

func QuerySessionVariables

func QuerySessionVariables(db *sql.DB) (map[string]string, error)

QuerySessionVariables returns a map of current session variables.

func Setup

func Setup(db *sql.DB) error

Setup creates the database schema.

func Teardown

func Teardown(db *sql.DB, drop bool) error

Teardown deletes the database schema(s).

Types

This section is empty.

Jump to

Keyboard shortcuts

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