15370: Re-enable docker tests.
[arvados.git] / lib / ctrlctx / db.go
index e8d9248ffcc58f89daf3302debde266b093862ed..36d79d3d2ef89ac9819d12e3f4e2f175c96426bd 100644 (file)
@@ -9,9 +9,10 @@ import (
        "errors"
        "sync"
 
-       "git.arvados.org/arvados.git/sdk/go/arvados"
+       "git.arvados.org/arvados.git/lib/controller/api"
        "git.arvados.org/arvados.git/sdk/go/ctxlog"
        "github.com/jmoiron/sqlx"
+       // sqlx needs lib/pq to talk to PostgreSQL
        _ "github.com/lib/pq"
 )
 
@@ -26,8 +27,8 @@ var (
 //
 // The wrapper calls getdb() to get a database handle before each API
 // call.
-func WrapCallsInTransactions(getdb func(context.Context) (*sqlx.DB, error)) func(arvados.RoutableFunc) arvados.RoutableFunc {
-       return func(origFunc arvados.RoutableFunc) arvados.RoutableFunc {
+func WrapCallsInTransactions(getdb func(context.Context) (*sqlx.DB, error)) func(api.RoutableFunc) api.RoutableFunc {
+       return func(origFunc api.RoutableFunc) api.RoutableFunc {
                return func(ctx context.Context, opts interface{}) (_ interface{}, err error) {
                        ctx, finishtx := New(ctx, getdb)
                        defer finishtx(&err)
@@ -66,7 +67,7 @@ type finishFunc func(*error)
 // commit or rollback the transaction, if any.
 //
 //     func example(ctx context.Context) (err error) {
-//             ctx, finishtx := NewContext(ctx, dber)
+//             ctx, finishtx := New(ctx, dber)
 //             defer finishtx(&err)
 //             // ...
 //             tx, err := CurrentTx(ctx)