MCPcopy Create free account
hub / github.com/daodst/chat / MustCreateDatabase

Function MustCreateDatabase

syncapi/storage/storage_test.go:20–29  ·  view source on GitHub ↗
(t *testing.T, dbType test.DBType)

Source from the content-addressed store, hash-verified

18var ctx = context.Background()
19
20func MustCreateDatabase(t *testing.T, dbType test.DBType) (storage.Database, func()) {
21 connStr, close := test.PrepareDBConnectionString(t, dbType)
22 db, err := storage.NewSyncServerDatasource(nil, &config.DatabaseOptions{
23 ConnectionString: config.DataSource(connStr),
24 })
25 if err != nil {
26 t.Fatalf("NewSyncServerDatasource returned %s", err)
27 }
28 return db, close
29}
30
31func MustWriteEvents(t *testing.T, db storage.Database, events []*gomatrixserverlib.HeaderedEvent) (positions []types.StreamPosition) {
32 for _, ev := range events {

Callers 4

TestWriteEventsFunction · 0.70
TestRecentEventsPDUFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected