Documentation
¶
Overview ¶
Package testdb opens the database that package tests run against. It imports only pkg/migrations (and, through it, pkg/models and pkg/identifiers) and pkg/sqliteconn, so tests in every other package can use it without an import cycle, including the packages pkg/testutils imports. The internal tests of pkg/migrations, pkg/models, and pkg/identifiers are the exception: they would import their own package through this one.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddQueryHook ¶ added in v0.3.0
AddQueryHook attaches hook to db, which must come from New or NewShared.
Tests often add a hook after building the services under test, which hold db already. bun's WithQueryHook returns a copy those services never use, so every database from open carries a forwardHook from the start, and this adds hook to it in place.
Types ¶
This section is empty.