summaryrefslogtreecommitdiff
path: root/vendor/github.com/uptrace/bun/hook.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/uptrace/bun/hook.go')
-rw-r--r--vendor/github.com/uptrace/bun/hook.go22
1 files changed, 2 insertions, 20 deletions
diff --git a/vendor/github.com/uptrace/bun/hook.go b/vendor/github.com/uptrace/bun/hook.go
index 7b60d2a28..7cca7ef6a 100644
--- a/vendor/github.com/uptrace/bun/hook.go
+++ b/vendor/github.com/uptrace/bun/hook.go
@@ -3,7 +3,6 @@ package bun
import (
"context"
"database/sql"
- "reflect"
"strings"
"sync/atomic"
"time"
@@ -11,18 +10,11 @@ import (
"github.com/uptrace/bun/schema"
)
-type IQuery interface {
- schema.QueryAppender
- Operation() string
- GetModel() Model
- GetTableName() string
-}
-
type QueryEvent struct {
DB *DB
QueryAppender schema.QueryAppender // Deprecated: use IQuery instead
- IQuery IQuery
+ IQuery Query
Query string
QueryArgs []interface{}
Model Model
@@ -58,7 +50,7 @@ type QueryHook interface {
func (db *DB) beforeQuery(
ctx context.Context,
- iquery IQuery,
+ iquery Query,
query string,
queryArgs []interface{},
model Model,
@@ -116,13 +108,3 @@ func (db *DB) afterQueryFromIndex(ctx context.Context, event *QueryEvent, hookIn
db.queryHooks[hookIndex].AfterQuery(ctx, event)
}
}
-
-//------------------------------------------------------------------------------
-
-func callBeforeScanHook(ctx context.Context, v reflect.Value) error {
- return v.Interface().(schema.BeforeScanHook).BeforeScan(ctx)
-}
-
-func callAfterScanHook(ctx context.Context, v reflect.Value) error {
- return v.Interface().(schema.AfterScanHook).AfterScan(ctx)
-}