validation

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package validation is a driver-agnostic test suite intended to aid in driver development for ADBC drivers. It provides a series of utilities and defined tests that can be used to validate a driver follows the correct and expected behavior.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectionTests

type ConnectionTests struct {
	suite.Suite

	Driver adbc.Driver
	Quirks DriverQuirks

	DB adbc.Database
}

func (*ConnectionTests) SetupTest

func (c *ConnectionTests) SetupTest()

func (*ConnectionTests) TearDownTest

func (c *ConnectionTests) TearDownTest()

func (*ConnectionTests) TestAutocommitDefault

func (c *ConnectionTests) TestAutocommitDefault()

func (*ConnectionTests) TestAutocommitToggle

func (c *ConnectionTests) TestAutocommitToggle()

func (*ConnectionTests) TestCloseConnTwice

func (c *ConnectionTests) TestCloseConnTwice()

func (*ConnectionTests) TestConcurrent

func (c *ConnectionTests) TestConcurrent()

func (*ConnectionTests) TestMetadataGetInfo

func (c *ConnectionTests) TestMetadataGetInfo()

func (*ConnectionTests) TestMetadataGetTableSchema

func (c *ConnectionTests) TestMetadataGetTableSchema()

func (*ConnectionTests) TestMetadataGetTableTypes

func (c *ConnectionTests) TestMetadataGetTableTypes()

func (*ConnectionTests) TestNewConn

func (c *ConnectionTests) TestNewConn()

type DatabaseTests

type DatabaseTests struct {
	suite.Suite

	Driver adbc.Driver
	Quirks DriverQuirks
}

func (*DatabaseTests) SetupTest

func (d *DatabaseTests) SetupTest()

func (*DatabaseTests) TearDownTest

func (d *DatabaseTests) TearDownTest()

func (*DatabaseTests) TestNewDatabase

func (d *DatabaseTests) TestNewDatabase()

type DriverQuirks

type DriverQuirks interface {
	// Called in SetupTest to initialize anything needed for testing
	SetupDriver(*testing.T) adbc.Driver
	// Called in TearDownTest to clean up anything necessary in between tests
	TearDownDriver(*testing.T, adbc.Driver)
	// Return the list of key/value pairs of options to pass when
	// calling NewDatabase
	DatabaseOptions() map[string]string
	// Return the SQL to reference the bind parameter for a given index
	BindParameter(index int) string
	// Whether two statements can be used at the same time on a single connection
	SupportsConcurrentStatements() bool
	// Whether AdbcStatementExecutePartitions should work
	SupportsPartitionedData() bool
	// Whether transactions are supported (Commit/Rollback on connection)
	SupportsTransactions() bool
	// Whether retrieving the schema of prepared statement params is supported
	SupportsGetParameterSchema() bool
	// Whether it supports dynamic parameter binding in queries
	SupportsDynamicParameterBinding() bool
	// Expected Metadata responses
	GetMetadata(adbc.InfoCode) interface{}
	// Create a sample table from an arrow record
	CreateSampleTable(tableName string, r arrow.Record) error

	Alloc() memory.Allocator
}

type StatementTests

type StatementTests struct {
	suite.Suite

	Driver adbc.Driver
	Quirks DriverQuirks

	DB   adbc.Database
	Cnxn adbc.Connection
	// contains filtered or unexported fields
}

func (*StatementTests) SetupTest

func (s *StatementTests) SetupTest()

func (*StatementTests) TearDownTest

func (s *StatementTests) TearDownTest()

func (*StatementTests) TestNewStatement

func (s *StatementTests) TestNewStatement()

func (*StatementTests) TestSQLPrepareGetParameterSchema

func (s *StatementTests) TestSQLPrepareGetParameterSchema()

func (*StatementTests) TestSQLPrepareSelectNoParams

func (s *StatementTests) TestSQLPrepareSelectNoParams()

func (*StatementTests) TestSQLPrepareSelectParams

func (s *StatementTests) TestSQLPrepareSelectParams()

func (*StatementTests) TestSqlPartitionedInts

func (s *StatementTests) TestSqlPartitionedInts()

func (*StatementTests) TestSqlPrepareErrorParamCountMismatch

func (s *StatementTests) TestSqlPrepareErrorParamCountMismatch()

Jump to

Keyboard shortcuts

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