package bun

import (
	
	
	

	
	
)

type (
	Safe  = schema.Safe
	Ident = schema.Ident

	NullTime  = schema.NullTime
	BaseModel = schema.BaseModel

	BeforeScanHook = schema.BeforeScanHook
	AfterScanHook  = schema.AfterScanHook
)

type BeforeSelectHook interface {
	BeforeSelect(ctx context.Context, query *SelectQuery) error
}

type AfterSelectHook interface {
	AfterSelect(ctx context.Context, query *SelectQuery) error
}

type BeforeInsertHook interface {
	BeforeInsert(ctx context.Context, query *InsertQuery) error
}

type AfterInsertHook interface {
	AfterInsert(ctx context.Context, query *InsertQuery) error
}

type BeforeUpdateHook interface {
	BeforeUpdate(ctx context.Context, query *UpdateQuery) error
}

type AfterUpdateHook interface {
	AfterUpdate(ctx context.Context, query *UpdateQuery) error
}

type BeforeDeleteHook interface {
	BeforeDelete(ctx context.Context, query *DeleteQuery) error
}

type AfterDeleteHook interface {
	AfterDelete(ctx context.Context, query *DeleteQuery) error
}

type BeforeCreateTableHook interface {
	BeforeCreateTable(ctx context.Context, query *CreateTableQuery) error
}

type AfterCreateTableHook interface {
	AfterCreateTable(ctx context.Context, query *CreateTableQuery) error
}

type BeforeDropTableHook interface {
	BeforeDropTable(ctx context.Context, query *DropTableQuery) error
}

type AfterDropTableHook interface {
	AfterDropTable(ctx context.Context, query *DropTableQuery) error
}

// SetLogger overwriters default Bun logger.
func ( internal.Logging) {
	internal.Logger = 
}

//------------------------------------------------------------------------------

type InValues struct {
	slice reflect.Value
	err   error
}

var _ schema.QueryAppender = InValues{}

func ( interface{}) InValues {
	 := reflect.ValueOf()
	if .Kind() != reflect.Slice {
		return InValues{
			err: fmt.Errorf("bun: In(non-slice %T)", ),
		}
	}
	return InValues{
		slice: ,
	}
}

func ( InValues) ( schema.Formatter,  []byte) ( []byte,  error) {
	if .err != nil {
		return nil, .err
	}
	return appendIn(, , .slice), nil
}

func ( schema.Formatter,  []byte,  reflect.Value) []byte {
	 := .Len()
	for  := 0;  < ; ++ {
		if  > 0 {
			 = append(, ", "...)
		}

		 := .Index()
		if .Kind() == reflect.Interface {
			 = .Elem()
		}

		if .Kind() == reflect.Slice {
			 = append(, '(')
			 = (, , )
			 = append(, ')')
		} else {
			 = .AppendValue(, )
		}
	}
	return 
}