MCPcopy
hub / github.com/openfga/openfga / DatastoreTestContainer

Interface DatastoreTestContainer

pkg/testfixtures/storage/storage.go:22–41  ·  view source on GitHub ↗

DatastoreTestContainer represents a runnable container for testing specific datastore engines.

Source from the content-addressed store, hash-verified

20
21// DatastoreTestContainer represents a runnable container for testing specific datastore engines.
22type DatastoreTestContainer interface {
23
24 // GetConnectionURI returns a connection string to the datastore instance running inside
25 // the container.
26 GetConnectionURI(includeCredentials bool) string
27
28 // GetDatabaseSchemaVersion returns the last migration applied (e.g. 3) when the container was created
29 GetDatabaseSchemaVersion() int64
30
31 GetUsername() string
32 GetPassword() string
33
34 // CreateSecondary creates a secondary datastore if supported.
35 // Returns an error if the operation fails or if the datastore doesn't support secondary datastores.
36 CreateSecondary(t testing.TB) error
37
38 // GetSecondaryConnectionURI returns the connection URI for the secondary datastore if one exists.
39 // Returns an empty string if no secondary datastore exists.
40 GetSecondaryConnectionURI(includeCredentials bool) string
41}
42
43type memoryTestContainer struct{}
44

Implementers 4

sqliteTestContainerpkg/testfixtures/storage/sqlite.go
memoryTestContainerpkg/testfixtures/storage/storage.go
mysqlTestContainerpkg/testfixtures/storage/mysql.go
postgresTestContainerpkg/testfixtures/storage/postgres.go

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…