Documentation
¶
Overview ¶
Package dbinspect captures the database schema state (tables, row counts, indexes) so every benchmark snapshot records what indexes existed BEFORE the run. Inspection uses the raw (unproxied) driver so its own queries never pollute the SQL statistics.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Index ¶
type Index struct {
Name string `json:"name"`
Columns string `json:"columns"`
Unique bool `json:"unique"`
}
Index is one index on a table.
type Schema ¶
type Schema struct {
Flavor string `json:"flavor"`
CapturedAt string `json:"captured_at"`
Error string `json:"error,omitempty"`
Tables []Table `json:"tables"`
}
Schema is the captured database state. Error is set instead of failing: inspection is best-effort and must never break measurement.
func Collect ¶
Collect inspects the schema through driverName+dsn. It always returns a non-nil Schema; failures are reported via Schema.Error.
func CollectRegistered ¶ added in v1.5.0
CollectRegistered inspects one logical target through the credential-safe registry. Unlike Collect it never opens the application's raw DSN and never copies a driver error into the report. The schema is bound explicitly because inspector sessions intentionally have no default database.