77 "fmt"
88 "regexp"
99
10- gorp "github.com/go-gorp/gorp/v3"
1110 "github.com/go-sql-driver/mysql"
11+ "github.com/letsencrypt/borp"
1212)
1313
1414// ErrDatabaseOp wraps an underlying err with a description of the operation
@@ -44,7 +44,7 @@ func (e ErrDatabaseOp) Unwrap() error {
4444
4545// IsNoRows is a utility function for determining if an error wraps the go sql
4646// package's ErrNoRows, which is returned when a Scan operation has no more
47- // results to return, and as such is returned by many gorp methods.
47+ // results to return, and as such is returned by many borp methods.
4848func IsNoRows (err error ) bool {
4949 return errors .Is (err , sql .ErrNoRows )
5050}
@@ -57,10 +57,10 @@ func IsDuplicate(err error) bool {
5757 return errors .As (err , & dbErr ) && dbErr .Number == 1062
5858}
5959
60- // WrappedMap wraps a *gorp .DbMap such that its major functions wrap error
60+ // WrappedMap wraps a *borp .DbMap such that its major functions wrap error
6161// results in ErrDatabaseOp instances before returning them to the caller.
6262type WrappedMap struct {
63- * gorp .DbMap
63+ * borp .DbMap
6464}
6565
6666func (m * WrappedMap ) Get (holder interface {}, keys ... interface {}) (interface {}, error ) {
@@ -95,7 +95,7 @@ func (m *WrappedMap) Exec(query string, args ...interface{}) (sql.Result, error)
9595 return WrappedExecutor {SqlExecutor : m .DbMap }.Exec (query , args ... )
9696}
9797
98- func (m * WrappedMap ) WithContext (ctx context.Context ) gorp .SqlExecutor {
98+ func (m * WrappedMap ) WithContext (ctx context.Context ) borp .SqlExecutor {
9999 return WrappedExecutor {SqlExecutor : m .DbMap .WithContext (ctx )}
100100}
101101
@@ -112,14 +112,14 @@ func (m *WrappedMap) Begin() (Transaction, error) {
112112 }, err
113113}
114114
115- // WrappedTransaction wraps a *gorp .Transaction such that its major functions
115+ // WrappedTransaction wraps a *borp .Transaction such that its major functions
116116// wrap error results in ErrDatabaseOp instances before returning them to the
117117// caller.
118118type WrappedTransaction struct {
119- * gorp .Transaction
119+ * borp .Transaction
120120}
121121
122- func (tx WrappedTransaction ) WithContext (ctx context.Context ) gorp .SqlExecutor {
122+ func (tx WrappedTransaction ) WithContext (ctx context.Context ) borp .SqlExecutor {
123123 return WrappedExecutor {SqlExecutor : tx .Transaction .WithContext (ctx )}
124124}
125125
@@ -163,11 +163,11 @@ func (tx WrappedTransaction) Exec(query string, args ...interface{}) (sql.Result
163163 return (WrappedExecutor {SqlExecutor : tx .Transaction }).Exec (query , args ... )
164164}
165165
166- // WrappedExecutor wraps a gorp .SqlExecutor such that its major functions
166+ // WrappedExecutor wraps a borp .SqlExecutor such that its major functions
167167// wrap error results in ErrDatabaseOp instances before returning them to the
168168// caller.
169169type WrappedExecutor struct {
170- gorp .SqlExecutor
170+ borp .SqlExecutor
171171}
172172
173173func errForOp (operation string , err error , list []interface {}) ErrDatabaseOp {
@@ -271,7 +271,7 @@ var (
271271
272272 // tableRegexps is a list of regexps that tableFromQuery will try to use in
273273 // succession to find the table name for an SQL query. While tableFromQuery
274- // isn't used by the higher level gorp Insert/Update/Select/etc functions we
274+ // isn't used by the higher level borp Insert/Update/Select/etc functions we
275275 // include regexps for matching inserts, updates, selects, etc because we want
276276 // to match the correct table when these types of queries are run through
277277 // Exec().
0 commit comments