Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConnectAndConfigureFromTest ¶ added in v0.0.23
ConnectAndConfigureFromTest is like Connect and Configure but accepts a testing.T in exchange for never returning an error--the test will be failed instead if there is one.
func Truncate ¶ added in v0.0.23
Truncate cleans up tables, intended for usage with functional tests. It will refuse to run if not given a testing.T or if Sherlock's current mode is anything other than 'debug'.
As an implementation note, the SQL this function runs is fairly consistent, but as Jack discovered, it is surprisingly annoying to debug, because it requires specific ordering, must be run manually, and (with the addition of v2 models) has effectively variable table names. This function handles and documents that complexity so we don't need to rediscover it each time we make a database change.
Types ¶
This section is empty.