Documentation
¶
Index ¶
- Constants
- func CapturePath(dir, testName string) string
- func NamedValues(args []driver.NamedValue) []any
- func NewConnector(conf Config, adapter Adapter) driver.Connector
- func NormalizeBackend(backend string) string
- func NormalizeDiscovery(discovery string) string
- func NormalizeFallback(fallback string) string
- func NormalizeSQL(query string) string
- type Adapter
- type CatalogMutator
- type Config
- type DiscoveryConfigurer
- type MetadataRefresher
- type QueryIDTracker
- type Rows
- type Session
Constants ¶
View Source
const ( BackendCapture = "capture" BackendDuckDB = "duckdb" FallbackPlaceholderOnError = "placeholder_on_error" FallbackStrict = "strict" DiscoveryInformationSchema = "information_schema" DiscoveryShow = "show" )
Variables ¶
This section is empty.
Functions ¶
func CapturePath ¶
func NamedValues ¶
func NamedValues(args []driver.NamedValue) []any
func NormalizeBackend ¶
func NormalizeDiscovery ¶
func NormalizeFallback ¶
func NormalizeSQL ¶
Types ¶
type Adapter ¶
type Adapter interface {
Name() string
DefaultSeedPath() string
ParseSeed(seedSQL string) (any, error)
NewSession(catalog any) Session
TranslateSetup(seedSQL string, catalog any) ([]string, error)
TranslateDiscoveryQuery(sql string, args []driver.NamedValue, catalog any) (string, []driver.NamedValue, error)
TranslateDiscoveryExec(sql string, args []driver.NamedValue, catalog any) ([]string, []driver.NamedValue, error)
TranslateRuntime(sql string, args []driver.NamedValue, catalog any) (string, []driver.NamedValue, error)
TranslateDirect(sql string, args []driver.NamedValue, catalog any) (string, []driver.NamedValue, error)
NormalizeIdentifier(identifier string) string
MapType(sourceType string) string
ClassifyPhase(sql string) string
}
type CatalogMutator ¶
type CatalogMutator interface {
ApplyDDL(sql string)
}
type DiscoveryConfigurer ¶
type DiscoveryConfigurer interface {
SetDiscoveryMode(mode string)
}
type MetadataRefresher ¶
type QueryIDTracker ¶ added in v3.18.30
type QueryIDTracker interface {
// IsQueryIDProducer reports whether sql sets the session's last query id.
IsQueryIDProducer(sql string) bool
// IsQueryIDQuery reports whether sql reads the session's last query id.
IsQueryIDQuery(sql string) bool
// CaptureQueryIDSQL returns a one-row, one-column query for the current id.
CaptureQueryIDSQL() string
}
QueryIDTracker is an optional Adapter capability for dialects (Snowflake) whose discovery reads a prior statement's result back via a session-scoped query id (LAST_QUERY_ID() + RESULT_SCAN). The harness captures the id per connection so concurrent discoveries don't race on shared emulator session state. Adapters that don't implement it (BigQuery) are unaffected.
Click to show internal directories.
Click to hide internal directories.