upstep bun to v1.0.14 (#291)

This commit is contained in:
tobi 2021-10-24 13:14:37 +02:00 committed by GitHub
commit 8b7c3507fe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
100 changed files with 5071 additions and 3836 deletions

View file

@ -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)
}