dbtest

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2025 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cases = []struct {
	Name string
	Fn   func(*testing.T, driver.TransactionalVersionedPersistence)
}{
	{"RangeQueries", TTestRangeQueries},
	{"Meta", TTestMeta},
	{"SimpleReadWrite", TTestSimpleReadWrite},
	{"GetNonExistent", TTestGetNonExistent},
	{"Metadata", TTestMetadata},
	{"DB1", TTestDB1},
	{"DB2", TTestDB2},
	{"RangeQueries1", TTestRangeQueries1},
	{"MultiWritesAndRangeQueries", TTestMultiWritesAndRangeQueries},
	{"TTestMultiWrites", TTestMultiWrites},
	{"CompositeKeys", TTestCompositeKeys},
}

This file exposes functions that db drivers can use for integration tests

View Source
var ErrorCases = []struct {
	Name string
	Fn   func(t *testing.T, readDB *sql.DB, writeDB *sql.DB, errorWrapper driver.SQLErrorWrapper, table string)
}{
	{"Duplicate", TTestDuplicate},
}
View Source
var UnversionedCases = []struct {
	Name string
	Fn   func(*testing.T, driver.UnversionedPersistence)
}{
	{"UnversionedSimple", TTestUnversionedSimple},
	{"UnversionedRange", TTestUnversionedRange},
	{"NonUTF8keys", TTestNonUTF8keys},
}
View Source
var UnversionedNotifierCases = []struct {
	Name string
	Fn   func(*testing.T, driver.UnversionedNotifier)
}{
	{"UnversionedNotifierSimple", TTestUnversionedNotifierSimple},
}
View Source
var VersionedNotifierCases = []struct {
	Name string
	Fn   func(*testing.T, driver.VersionedNotifier)
}{
	{"VersionedNotifierSimple", TTestVersionedNotifierSimple},
}

Functions

func BenchmarkBuilder

func BenchmarkBuilder(b *testing.B)

func BenchmarkConcatenation

func BenchmarkConcatenation(b *testing.B)

func FromBytes

func FromBytes(data driver3.RawVersion) (driver3.BlockNum, driver3.TxNum, error)

func TTestDuplicate

func TTestDuplicate(t *testing.T, _ *sql.DB, writeDB *sql.DB, errorWrapper driver.SQLErrorWrapper, table string)

func TTestMultiWritesAndRangeQueries

func TTestMultiWritesAndRangeQueries(t *testing.T, db driver.TransactionalVersionedPersistence)

func TTestNonUTF8keys

func TTestNonUTF8keys(t *testing.T, db driver.UnversionedPersistence)

Postgres doesn't like non-utf8 in TEXT fields, so we made it a BYTEA. cannot check if key exists: pq: invalid byte sequence for encoding "UTF8": 0xc2 0x32]

func TTestSimpleReadWrite

func TTestSimpleReadWrite(t *testing.T, db driver.TransactionalVersionedPersistence)

func TTestUnversionedNotifierSimple

func TTestUnversionedNotifierSimple(t *testing.T, db driver.UnversionedNotifier)

func TTestUnversionedRange

func TTestUnversionedRange(t *testing.T, db driver.UnversionedPersistence)

func TTestUnversionedSimple

func TTestUnversionedSimple(t *testing.T, db driver.UnversionedPersistence)

func TTestVersionedNotifierSimple

func TTestVersionedNotifierSimple(t *testing.T, db driver.VersionedNotifier)

func ToBytes

func ToBytes(Block driver3.BlockNum, TxNum driver3.TxNum) []byte

Types

This section is empty.

Jump to

Keyboard shortcuts

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