[chore] Update bun and sqlite dependencies (#478)

* update bun + sqlite versions

* step bun to v1.1.3
This commit is contained in:
tobi 2022-04-24 12:26:22 +02:00 committed by GitHub
commit 88979b35d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
246 changed files with 409690 additions and 148967 deletions

View file

@ -94,6 +94,8 @@ func scanner(typ reflect.Type) ScannerFunc {
}
switch typ {
case bytesType:
return scanBytes
case timeType:
return scanTime
case ipType:
@ -134,12 +136,22 @@ func scanBool(dest reflect.Value, src interface{}) error {
dest.SetBool(src != 0)
return nil
case []byte:
if len(src) == 1 {
dest.SetBool(src[0] != '0')
return nil
f, err := strconv.ParseBool(internal.String(src))
if err != nil {
return err
}
dest.SetBool(f)
return nil
case string:
f, err := strconv.ParseBool(src)
if err != nil {
return err
}
dest.SetBool(f)
return nil
default:
return scanError(dest.Type(), src)
}
return fmt.Errorf("bun: can't scan %#v into %s", src, dest.Type())
}
func scanInt64(dest reflect.Value, src interface{}) error {
@ -167,8 +179,9 @@ func scanInt64(dest reflect.Value, src interface{}) error {
}
dest.SetInt(n)
return nil
default:
return scanError(dest.Type(), src)
}
return fmt.Errorf("bun: can't scan %#v into %s", src, dest.Type())
}
func scanUint64(dest reflect.Value, src interface{}) error {
@ -189,8 +202,16 @@ func scanUint64(dest reflect.Value, src interface{}) error {
}
dest.SetUint(n)
return nil
case string:
n, err := strconv.ParseUint(src, 10, 64)
if err != nil {
return err
}
dest.SetUint(n)
return nil
default:
return scanError(dest.Type(), src)
}
return fmt.Errorf("bun: can't scan %#v into %s", src, dest.Type())
}
func scanFloat64(dest reflect.Value, src interface{}) error {
@ -208,8 +229,16 @@ func scanFloat64(dest reflect.Value, src interface{}) error {
}
dest.SetFloat(f)
return nil
case string:
f, err := strconv.ParseFloat(src, 64)
if err != nil {
return err
}
dest.SetFloat(f)
return nil
default:
return scanError(dest.Type(), src)
}
return fmt.Errorf("bun: can't scan %#v into %s", src, dest.Type())
}
func scanString(dest reflect.Value, src interface{}) error {
@ -226,8 +255,18 @@ func scanString(dest reflect.Value, src interface{}) error {
case time.Time:
dest.SetString(src.Format(time.RFC3339Nano))
return nil
case int64:
dest.SetString(strconv.FormatInt(src, 10))
return nil
case uint64:
dest.SetString(strconv.FormatUint(src, 10))
return nil
case float64:
dest.SetString(strconv.FormatFloat(src, 'G', -1, 64))
return nil
default:
return scanError(dest.Type(), src)
}
return fmt.Errorf("bun: can't scan %#v into %s", src, dest.Type())
}
func scanBytes(dest reflect.Value, src interface{}) error {
@ -244,8 +283,9 @@ func scanBytes(dest reflect.Value, src interface{}) error {
dest.SetBytes(clone)
return nil
default:
return scanError(dest.Type(), src)
}
return fmt.Errorf("bun: can't scan %#v into %s", src, dest.Type())
}
func scanTime(dest reflect.Value, src interface{}) error {
@ -274,8 +314,9 @@ func scanTime(dest reflect.Value, src interface{}) error {
destTime := dest.Addr().Interface().(*time.Time)
*destTime = srcTime
return nil
default:
return scanError(dest.Type(), src)
}
return fmt.Errorf("bun: can't scan %#v into %s", src, dest.Type())
}
func scanScanner(dest reflect.Value, src interface{}) error {
@ -438,7 +479,7 @@ func scanJSONIntoInterface(dest reflect.Value, src interface{}) error {
if fn := Scanner(dest.Type()); fn != nil {
return fn(dest, src)
}
return fmt.Errorf("bun: can't scan %#v into %s", src, dest.Type())
return scanError(dest.Type(), src)
}
func scanInterface(dest reflect.Value, src interface{}) error {
@ -454,7 +495,7 @@ func scanInterface(dest reflect.Value, src interface{}) error {
if fn := Scanner(dest.Type()); fn != nil {
return fn(dest, src)
}
return fmt.Errorf("bun: can't scan %#v into %s", src, dest.Type())
return scanError(dest.Type(), src)
}
func nilable(kind reflect.Kind) bool {
@ -464,3 +505,7 @@ func nilable(kind reflect.Kind) bool {
}
return false
}
func scanError(dest reflect.Type, src interface{}) error {
return fmt.Errorf("bun: can't scan %#v (%T) into %s", src, src, dest.String())
}