Documentation
¶
Overview ¶
Package sqlite provides shared SQLite fixtures and typed SQLX result verification for dependency-light data-driven tests.
Index ¶
- Constants
- type Harness
- func (h *Harness) AssertQuery(t testing.TB, ctx context.Context, query Query, expected any)
- func (h *Harness) ExecStatements(ctx context.Context, statements ...string) error
- func (h *Harness) FaultDB(t testing.TB, before func(context.Context, sqlfault.Call) error) *sql.DB
- func (h *Harness) LoadSQLFile(ctx context.Context, path string) error
- func (h *Harness) ObserveWrites(t testing.TB, ctx context.Context, table string) *atomic.Int64
- func (h *Harness) ReadQuery(ctx context.Context, query Query, sliceType reflect.Type) (any, error)
- type Option
- type Query
Constants ¶
const DatlyJobsSchema = `` /* 640-byte string literal not displayed */
DatlyJobsSchema is the original DATLY_JOBS column set, adapted only for SQLite storage types. Schema creation is explicit; existing tables are never migrated.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Harness ¶
func (*Harness) AssertQuery ¶
AssertQuery reads typed rows through SQLX and compares them in query order. Expected must be a slice of structs or pointers to structs. Specify ORDER BY in the query when deterministic ordering is part of the assertion.
func (*Harness) ExecStatements ¶
func (*Harness) ObserveWrites ¶
ObserveWrites counts actual changes to one business table, including changes subsequently rolled back. Use a one-connection pool; allocator metadata and zero-row INSERT statements do not produce table update events.