[chore] bump db dependencies (#1366)

This commit is contained in:
tobi 2023-01-22 12:26:47 +01:00 committed by GitHub
commit 0ceacd7b1d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
78 changed files with 141878 additions and 126068 deletions

View file

@ -27,6 +27,9 @@ var (
float64Type = reflect.TypeOf((*float64)(nil)).Elem()
sliceFloat64Type = reflect.TypeOf([]float64(nil))
timeType = reflect.TypeOf((*time.Time)(nil)).Elem()
sliceTimeType = reflect.TypeOf([]time.Time(nil))
)
func arrayAppend(fmter schema.Formatter, b []byte, v interface{}) []byte {
@ -93,6 +96,8 @@ func (d *Dialect) arrayAppender(typ reflect.Type) schema.AppenderFunc {
return appendInt64SliceValue
case float64Type:
return appendFloat64SliceValue
case timeType:
return appendTimeSliceValue
}
}
@ -308,6 +313,32 @@ func arrayAppendString(b []byte, s string) []byte {
return b
}
func appendTimeSliceValue(fmter schema.Formatter, b []byte, v reflect.Value) []byte {
ts := v.Convert(sliceTimeType).Interface().([]time.Time)
return appendTimeSlice(fmter, b, ts)
}
func appendTimeSlice(fmter schema.Formatter, b []byte, ts []time.Time) []byte {
if ts == nil {
return dialect.AppendNull(b)
}
b = append(b, '\'')
b = append(b, '{')
for _, t := range ts {
b = append(b, '"')
b = t.UTC().AppendFormat(b, "2006-01-02 15:04:05.999999-07:00")
b = append(b, '"')
b = append(b, ',')
}
if len(ts) > 0 {
b[len(b)-1] = '}' // Replace trailing comma.
} else {
b = append(b, '}')
}
b = append(b, '\'')
return b
}
//------------------------------------------------------------------------------
var mapStringStringType = reflect.TypeOf(map[string]string(nil))

View file

@ -45,6 +45,10 @@ var (
jsonRawMessageType = reflect.TypeOf((*json.RawMessage)(nil)).Elem()
)
func (d *Dialect) DefaultVarcharLen() int {
return 0
}
func fieldSQLType(field *schema.Field) string {
if field.UserSQLType != "" {
return field.UserSQLType

View file

@ -2,5 +2,5 @@ package pgdialect
// Version is the current release version.
func Version() string {
return "1.1.9"
return "1.1.10"
}

View file

@ -87,6 +87,10 @@ func (d *Dialect) AppendBytes(b []byte, bs []byte) []byte {
return b
}
func (d *Dialect) DefaultVarcharLen() int {
return 0
}
func fieldSQLType(field *schema.Field) string {
switch field.DiscoveredSQLType {
case sqltype.SmallInt, sqltype.BigInt:

View file

@ -2,5 +2,5 @@ package sqlitedialect
// Version is the current release version.
func Version() string {
return "1.1.9"
return "1.1.10"
}