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 ¶
- func CheckedCleanup(t *testing.T, c func() error)
- func CheckedClose(t *testing.T, c io.Closer)
- type ConnectionTests
- func (c *ConnectionTests) SetupTest()
- func (c *ConnectionTests) TearDownTest()
- func (c *ConnectionTests) TestAutocommitDefault()
- func (c *ConnectionTests) TestAutocommitToggle()
- func (c *ConnectionTests) TestCloseConnTwice()
- func (c *ConnectionTests) TestConcurrent()
- func (c *ConnectionTests) TestGetSetOptions()
- func (c *ConnectionTests) TestMetadataCurrentCatalog()
- func (c *ConnectionTests) TestMetadataCurrentDbSchema()
- func (c *ConnectionTests) TestMetadataGetInfo()
- func (c *ConnectionTests) TestMetadataGetObjectsColumns()
- func (c *ConnectionTests) TestMetadataGetStatistics()
- func (c *ConnectionTests) TestMetadataGetTableSchema()
- func (c *ConnectionTests) TestMetadataGetTableTypes()
- func (c *ConnectionTests) TestNewConn()
- type DatabaseTests
- type DriverQuirks
- type StatementTests
- func (s *StatementTests) SetupTest()
- func (s *StatementTests) TearDownTest()
- func (s *StatementTests) TestNewStatement()
- func (s *StatementTests) TestSQLPrepareGetParameterSchema()
- func (s *StatementTests) TestSQLPrepareSelectNoParams()
- func (s *StatementTests) TestSQLPrepareSelectParams()
- func (s *StatementTests) TestSqlExecuteSchema()
- func (s *StatementTests) TestSqlIngestAppend()
- func (s *StatementTests) TestSqlIngestCreateAppend()
- func (s *StatementTests) TestSqlIngestErrors()
- func (s *StatementTests) TestSqlIngestInts()
- func (s *StatementTests) TestSqlIngestReplace()
- func (s *StatementTests) TestSqlPartitionedInts()
- func (s *StatementTests) TestSqlPrepareErrorParamCountMismatch()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckedCleanup ¶ added in v1.6.0
CheckedClose is a helper for deferring a function with a potential error in a test. For example: `defer CheckedCleanup(suite.T(), func() error { return os.Remove(path) })`
Types ¶
type ConnectionTests ¶
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) TestGetSetOptions ¶ added in v0.7.0
func (c *ConnectionTests) TestGetSetOptions()
func (*ConnectionTests) TestMetadataCurrentCatalog ¶ added in v0.7.0
func (c *ConnectionTests) TestMetadataCurrentCatalog()
func (*ConnectionTests) TestMetadataCurrentDbSchema ¶ added in v0.7.0
func (c *ConnectionTests) TestMetadataCurrentDbSchema()
func (*ConnectionTests) TestMetadataGetInfo ¶
func (c *ConnectionTests) TestMetadataGetInfo()
func (*ConnectionTests) TestMetadataGetObjectsColumns ¶ added in v0.4.0
func (c *ConnectionTests) TestMetadataGetObjectsColumns()
func (*ConnectionTests) TestMetadataGetStatistics ¶ added in v0.7.0
func (c *ConnectionTests) TestMetadataGetStatistics()
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 the driver supports bulk ingest
SupportsBulkIngest(mode string) bool
// Whether two statements can be used at the same time on a single connection
SupportsConcurrentStatements() bool
// Whether current catalog/schema are supported
SupportsCurrentCatalogSchema() bool
// Whether GetSetOptions is supported
SupportsGetSetOptions() bool
// Whether AdbcStatementExecuteSchema should work
SupportsExecuteSchema() bool
// Whether AdbcStatementExecutePartitions should work
SupportsPartitionedData() bool
// Whether statistics are supported
SupportsStatistics() 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
// Whether it returns an error when attempting to ingest with an incompatible schema
SupportsErrorIngestIncompatibleSchema() bool
// Expected Metadata responses
GetMetadata(adbc.InfoCode) interface{}
// Create a sample table from an arrow record
CreateSampleTable(tableName string, r arrow.RecordBatch) error
// Field Metadata for Sample Table for comparison
SampleTableSchemaMetadata(tblName string, dt arrow.DataType) arrow.Metadata
// have the driver drop a table with the correct SQL syntax
DropTable(adbc.Connection, string) error
Catalog() string
DBSchema() string
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) TestSqlExecuteSchema ¶ added in v0.7.0
func (s *StatementTests) TestSqlExecuteSchema()
func (*StatementTests) TestSqlIngestAppend ¶ added in v0.4.0
func (s *StatementTests) TestSqlIngestAppend()
func (*StatementTests) TestSqlIngestCreateAppend ¶ added in v0.7.0
func (s *StatementTests) TestSqlIngestCreateAppend()
func (*StatementTests) TestSqlIngestErrors ¶ added in v0.4.0
func (s *StatementTests) TestSqlIngestErrors()
func (*StatementTests) TestSqlIngestInts ¶ added in v0.4.0
func (s *StatementTests) TestSqlIngestInts()
func (*StatementTests) TestSqlIngestReplace ¶ added in v0.7.0
func (s *StatementTests) TestSqlIngestReplace()
func (*StatementTests) TestSqlPartitionedInts ¶
func (s *StatementTests) TestSqlPartitionedInts()
func (*StatementTests) TestSqlPrepareErrorParamCountMismatch ¶
func (s *StatementTests) TestSqlPrepareErrorParamCountMismatch()
Click to show internal directories.
Click to hide internal directories.