package
0.0.0-20250220232038-fb2fd8af7512
Repository: https://github.com/letsencrypt/boulder.git
Documentation: pkg.go.dev
# Functions
IsDuplicate is a utility function for determining if an error wrap MySQL's Error 1062: Duplicate entry.
IsNoRows is a utility function for determining if an error wraps the go sql package's ErrNoRows, which is returned when a Scan operation has no more results to return, and as such is returned by many borp methods.
NewMappedSelector returns an object which can be used to automagically query the provided type-mapped database for rows of the parameterized type.
NewMultiInserter creates a new MultiInserter, checking for reasonable table name and list of fields.
QuestionMarks returns a string consisting of N question marks, joined by commas.
WithTransaction runs the given function in a transaction, rolling back if it returns an error and committing if not.
# Structs
ErrDatabaseOp wraps an underlying err with a description of the operation that was being performed when the error occurred (insert, select, select one, exec, etc) and the table that the operation was being performed on.
MockSqlExecutor implement SqlExecutor by returning errors from every call.
MultiInserter makes it easy to construct a `INSERT INTO table (...) VALUES ...;` query which inserts multiple rows into the same table.
RollbackError is a combination of a database error and the error, if any, encountered while trying to rollback the transaction.
WrappedExecutor wraps a borp.SqlExecutor such that its major functions wrap error results in ErrDatabaseOp instances before returning them to the caller.
WrappedMap wraps a *borp.DbMap such that its major functions wrap error results in ErrDatabaseOp instances before returning them to the caller.
WrappedTransaction wraps a *borp.Transaction such that its major functions wrap error results in ErrDatabaseOp instances before returning them to the caller.
# Interfaces
DatabaseMap offers the full combination of OneSelector, Inserter, SelectExecer, and a Begin function for creating a Transaction.
A Execer is anything that provides an `ExecContext` function.
Executor offers the full combination of OneSelector, Inserter, SelectExecer and adds a handful of other high level borp methods we use in Boulder.
A Inserter is anything that provides an `Insert` function.
MappedExecutor is anything that can map types to tables.
MappedSelector is anything that can execute various kinds of SQL statements against a table automatically determined from the parameterized type.
A OneSelector is anything that provides a `SelectOne` function.
Rows is anything which lets you iterate over the result rows of a SELECT query.
SelectExecer offers a subset of borp.SqlExecutor's methods: Select and ExecContext.
A Selector is anything that provides a `Select` function.
Transaction extends an Executor and adds Rollback and Commit.