# Packages
No description provided by the author
# Functions
DisableLog disables all library log output.
IsSerializationError returns true if the given error is a serialization error.
MapSQLError attempts to interpret a given error as a database agnostic SQL error.
NewPostgresStore creates a new store that is backed by a Postgres database backend.
NewSqliteStore attempts to open a new sqlite database based on the passed config.
NewTestPgFixture constructs a new TestPgFixture starting up a docker container running Postgres 11.
NewTestPostgresDB is a helper function that creates a Postgres database for testing.
NewTestSqliteDB is a helper function that creates an SQLite database for testing.
NewTransactionExecutor creates a new instance of a TransactionExecutor given a Querier query object and a concrete type for the type of transactions the Querier understands.
UseLogger uses a specified Logger to output package logging info.
WithTxRetries is a functional option that allows us to specify the number of times a transaction should be retried if it fails with a repeatable error.
WithTxRetryDelay is a functional option that allows us to specify the delay to wait before a transaction is retried.
# Constants
DefaultNumTxRetries is the default number of times we'll retry a transaction if it fails with an error that permits transaction repetition.
DefaultRetryDelay is the default delay between retries.
No description provided by the author
Subsystem defines the logging code for this subsystem.
# Variables
DefaultPostgresFixtureLifetime is the default maximum time a Postgres test fixture is being kept alive.
DefaultStoreTimeout is the default timeout used for any interaction with the storage/database.
ErrRetriesExceeded is returned when a transaction is retried more than the max allowed valued without a success.
# Structs
BaseDB is the base database struct that each implementation can embed to gain some common functionality.
ErrSerializationError is an error type which represents a database agnostic error that a transaction couldn't be serialized with other concurrent db transactions.
ErrSQLUniqueConstraintViolation is an error type which represents a database agnostic SQL unique constraint violation.
PostgresConfig holds the postgres database configuration.
PostgresStore is a database store implementation that uses a Postgres backend.
SqliteConfig holds all the config arguments needed to interact with our sqlite DB.
SqliteStore is a database store implementation that uses a sqlite backend.
TestPgFixture is a test fixture that starts a Postgres 11 instance in a docker container.
TransactionExecutor is a generic struct that abstracts away from the type of query a type needs to run under a database transaction, and also the set of options for that transaction.
# Interfaces
BatchedQuerier is a generic interface that allows callers to create a new database transaction based on an abstract type that implements the TxOptions interface.
BatchedTx is a generic interface that represents the ability to execute several operations to a given storage interface in a single atomic transaction.
Tx represents a database transaction that can be committed or rolled back.
TxOptions represents a set of options one can use to control what type of database transaction is created.
# Type aliases
QueryCreator is a generic function that's used to create a Querier, which is a type of interface that implements storage related methods from a database transaction.
TxExecutorOption is a functional option that allows us to pass in optional argument when creating the executor.