Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterTxDb ¶
txdb is a simplified version of https://github.com/DATA-DOG/go-txdb
The original lib has various problems and is hard to understand because it tries to be more general. The version in this file is more tightly focused to our needs and should be easier to reason about and less likely to have subtle bugs/races.
It doesn't currently support savepoints but could be made to if necessary.
Transaction BEGIN/ROLLBACK effectively becomes a no-op, this should have no negative impact on normal test operation.
If you MUST test BEGIN/ROLLBACK behaviour, you will have to configure your store to use the raw DialectPostgres dialect and setup a one-use database. See heavyweight.FullTestDB() as a convenience function to help you do this, but please use sparingly because as it's name implies, it is expensive.
Types ¶
type DialectName ¶
type DialectName string
DialectName is a compiler enforced type used that maps to database dialect names
const ( // Postgres represents the postgres dialect. Postgres DialectName = "pgx" // TransactionWrappedPostgres is useful for tests. // When the connection is opened, it starts a transaction and all // operations performed on the DB will be within that transaction. TransactionWrappedPostgres DialectName = "txdb" InMemoryPostgres DialectName = "duckdb" )