mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 12:24:38 +03:00
Replace packr with go embed (#1751)
* Embed performer images * Embed schema migrations * Update dependencies * Embed UI * Remove remaining packr references
This commit is contained in:
24
vendor/github.com/jmoiron/sqlx/sqlx.go
generated
vendored
24
vendor/github.com/jmoiron/sqlx/sqlx.go
generated
vendored
@@ -64,11 +64,7 @@ func isScannable(t reflect.Type) bool {
|
||||
|
||||
// it's not important that we use the right mapper for this particular object,
|
||||
// we're only concerned on how many exported fields this struct has
|
||||
m := mapper()
|
||||
if len(m.TypeMap(t).Index) == 0 {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
return len(mapper().TypeMap(t).Index) == 0
|
||||
}
|
||||
|
||||
// ColScanner is an interface used by MapScan and SliceScan
|
||||
@@ -149,15 +145,15 @@ func isUnsafe(i interface{}) bool {
|
||||
}
|
||||
|
||||
func mapperFor(i interface{}) *reflectx.Mapper {
|
||||
switch i.(type) {
|
||||
switch i := i.(type) {
|
||||
case DB:
|
||||
return i.(DB).Mapper
|
||||
return i.Mapper
|
||||
case *DB:
|
||||
return i.(*DB).Mapper
|
||||
return i.Mapper
|
||||
case Tx:
|
||||
return i.(Tx).Mapper
|
||||
return i.Mapper
|
||||
case *Tx:
|
||||
return i.(*Tx).Mapper
|
||||
return i.Mapper
|
||||
default:
|
||||
return mapper()
|
||||
}
|
||||
@@ -380,6 +376,14 @@ func (db *DB) PrepareNamed(query string) (*NamedStmt, error) {
|
||||
return prepareNamed(db, query)
|
||||
}
|
||||
|
||||
// Conn is a wrapper around sql.Conn with extra functionality
|
||||
type Conn struct {
|
||||
*sql.Conn
|
||||
driverName string
|
||||
unsafe bool
|
||||
Mapper *reflectx.Mapper
|
||||
}
|
||||
|
||||
// Tx is an sqlx wrapper around sql.Tx with extra functionality
|
||||
type Tx struct {
|
||||
*sql.Tx
|
||||
|
||||
Reference in New Issue
Block a user