MCPcopy
hub / github.com/benbjohnson/litestream / MustCloseSQLDB

Function MustCloseSQLDB

internal/testingutil/testingutil.go:221–226  ·  view source on GitHub ↗

MustCloseSQLDB closes a database/sql DB.

(tb testing.TB, d *sql.DB)

Source from the content-addressed store, hash-verified

219
220// MustCloseSQLDB closes a database/sql DB.
221func MustCloseSQLDB(tb testing.TB, d *sql.DB) {
222 tb.Helper()
223 if err := d.Close(); err != nil {
224 tb.Fatal(err)
225 }
226}
227
228// NewReplicaClient returns a new client for integration testing by type name.
229func NewReplicaClient(tb testing.TB, typ string) litestream.ReplicaClient {

Callers 15

TestStore_IntegrationFunction · 0.92
createTestLTXSnapshotFunction · 0.92
createTestSQLiteDBFunction · 0.92
createTestWALSequenceFunction · 0.92
verifyRestoredDBFunction · 0.92
TestDB_SyncFunction · 0.92
TestVFS_LongRunningSoakFunction · 0.92

Calls 1

CloseMethod · 0.45

Tested by 15

TestStore_IntegrationFunction · 0.74
createTestLTXSnapshotFunction · 0.74
createTestSQLiteDBFunction · 0.74
createTestWALSequenceFunction · 0.74
verifyRestoredDBFunction · 0.74
TestDB_SyncFunction · 0.74
TestVFS_LongRunningSoakFunction · 0.74