# Functions
DeleteCreatedEntitiesAfterTest sets up GORM `onCreate` hook and return a function that can be deferred to remove all the entities created after the hook was set up You can use it as
func TestSomething(t *testing.T){ db, _ := gorm.Open(...)
cleaner := DeleteCreatedEntities(db) defer cleaner()
}.
GenerateRandomString generates a random string based on the size specified by the client.
The New function creates a new client with optional configuration options.
NewInMemoryTestDbClient creates a new in memory test db client This is useful only for unit tests.
WithConnectionString sets the connection string.
WithInstrumentationClient sets the instrumentation client.
WithLogger sets the logger.
WithMaxConnectionLifetime sets the max connection lifetime.
WithMaxConnectionRetries sets the max connection retries.
WithMaxConnectionRetryTimeout sets the max connection retry timeout.
WithMaxIdleConnections sets the max idle connections.
WithMaxOpenConnections sets the max open connections.
WithQueryTimeout sets the query timeout.
WithRetrySleep sets the retry sleep.
# Structs
Client is defining a new struct type called `Client` which will be used to create instances of a client for connecting to a PostgreSQL database.
TestTxCleanupHandlerForUnitTests is a handler that can be used to rollback a transaction to a save point.