From ec325fee141c1e9757144a0a4094061b56839b78 Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Fri, 12 May 2023 14:33:40 +0200 Subject: [chore] Update a bunch of database dependencies (#1772) * [chore] Update a bunch of database dependencies * fix lil thing --- vendor/github.com/uptrace/bun/schema/append.go | 5 +++++ vendor/github.com/uptrace/bun/schema/table.go | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'vendor/github.com/uptrace/bun/schema') diff --git a/vendor/github.com/uptrace/bun/schema/append.go b/vendor/github.com/uptrace/bun/schema/append.go index 04538c036..6f633b101 100644 --- a/vendor/github.com/uptrace/bun/schema/append.go +++ b/vendor/github.com/uptrace/bun/schema/append.go @@ -79,6 +79,11 @@ func (in *inValues) AppendQuery(fmter Formatter, b []byte) (_ []byte, err error) func appendIn(fmter Formatter, b []byte, slice reflect.Value) []byte { sliceLen := slice.Len() + + if sliceLen == 0 { + return append(b, "NULL"...) + } + for i := 0; i < sliceLen; i++ { if i > 0 { b = append(b, ", "...) diff --git a/vendor/github.com/uptrace/bun/schema/table.go b/vendor/github.com/uptrace/bun/schema/table.go index ed8c517c1..9eb7d1bfe 100644 --- a/vendor/github.com/uptrace/bun/schema/table.go +++ b/vendor/github.com/uptrace/bun/schema/table.go @@ -534,7 +534,7 @@ func (t *Table) belongsToRelation(field *Field) *Relation { } else { panic(fmt.Errorf( "bun: %s belongs-to %s: %s must have column %s", - t.TypeName, field.GoName, t.TypeName, baseColumn, + t.TypeName, field.GoName, joinTable.TypeName, joinColumn, )) } } @@ -588,7 +588,7 @@ func (t *Table) hasOneRelation(field *Field) *Relation { } else { panic(fmt.Errorf( "bun: %s has-one %s: %s must have column %s", - field.GoName, t.TypeName, joinTable.TypeName, baseColumn, + field.GoName, t.TypeName, t.TypeName, baseColumn, )) } @@ -598,7 +598,7 @@ func (t *Table) hasOneRelation(field *Field) *Relation { } else { panic(fmt.Errorf( "bun: %s has-one %s: %s must have column %s", - field.GoName, t.TypeName, joinTable.TypeName, baseColumn, + field.GoName, t.TypeName, joinTable.TypeName, joinColumn, )) } } @@ -677,7 +677,7 @@ func (t *Table) hasManyRelation(field *Field) *Relation { } else { panic(fmt.Errorf( "bun: %s has-many %s: %s must have column %s", - t.TypeName, field.GoName, t.TypeName, baseColumn, + t.TypeName, field.GoName, joinTable.TypeName, joinColumn, )) } } -- cgit v1.3