drivertest

package
v0.103.2 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package drivertest provides utilities for driver testing.

Index

Constants

View Source
const (
	CondNone = iota
	CondEQ   // equal
	CondLT   // less than
	CondGE   // greater equal
)

test run condition constants

Variables

This section is empty.

Functions

func ConnectionID

func ConnectionID(db *sql.DB) (int, error)

ConnectionID returns the hdb connection id.

func CreateSchema

func CreateSchema(db *sql.DB, schema string) error

CreateSchema creates a schema on the database.

func DSN

func DSN() string

DSN returns the dsn parameter.

func DefaultAttrs

func DefaultAttrs() map[string]interface{}

DefaultAttrs returns the key value map of connector default testing attributes.

func DropSchema

func DropSchema(db *sql.DB, schema string) error

DropSchema drops a schema from the database.

func DropTable

func DropTable(db *sql.DB, schema, table string) error

DropTable drops a table from the database.

func DummySelect

func DummySelect(db *sql.DB) error

DummySelect executes a select dummy on hdb.

func NumProcsInSchema

func NumProcsInSchema(db *sql.DB, schema string) (int, error)

NumProcsInSchema returns the number of stored procedures in a database schema.

func NumTablesInSchema

func NumTablesInSchema(db *sql.DB, schema string) (int, error)

NumTablesInSchema returns the number of tables in a database schema.

func PingInterval

func PingInterval() int

PingInterval returns the ping interval.

func QuerySchemasPrefix

func QuerySchemasPrefix(db *sql.DB, prefix string) ([]string, error)

QuerySchemasPrefix returns all schemas of a database starting with prefix in name.

func QueryTablesPrefix

func QueryTablesPrefix(db *sql.DB, prefix string) ([]string, error)

QueryTablesPrefix returns all tables of a database starting with prefix in name.

func Schema

func Schema() string

Schema returns the database schema.

func SessionVariable

func SessionVariable(k string, db *sql.DB) (string, error)

SessionVariable returns the value of a session variable.

func SessionVariables

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

SessionVariables returns a map of current session variables.

func Setup

func Setup(db *sql.DB)

Setup creates the database schema.

func Teardown

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

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