diff options
author | 2021-09-08 21:13:54 +0100 | |
---|---|---|
committer | 2021-09-08 21:13:54 +0100 | |
commit | 6a2d0d9508392425392738743fa4dd5b5d93bdb4 (patch) | |
tree | 2c076235c197acbb9080745fc79a4b41aaa5452e /vendor/github.com/uptrace/bun/model_table_slice.go | |
parent | update sqlite library -> v1.13.0 (diff) | |
parent | Merge pull request #195 from NyaaaWhatsUpDoc/update/bun-library (diff) | |
download | gotosocial-6a2d0d9508392425392738743fa4dd5b5d93bdb4.tar.xz |
Merge remote-tracking branch 'upstream/main' into update/sqlite-library
Signed-off-by: kim (grufwub) <grufwub@gmail.com>
Diffstat (limited to 'vendor/github.com/uptrace/bun/model_table_slice.go')
-rw-r--r-- | vendor/github.com/uptrace/bun/model_table_slice.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/vendor/github.com/uptrace/bun/model_table_slice.go b/vendor/github.com/uptrace/bun/model_table_slice.go index 67e7c71e7..2fccaa5e7 100644 --- a/vendor/github.com/uptrace/bun/model_table_slice.go +++ b/vendor/github.com/uptrace/bun/model_table_slice.go @@ -4,6 +4,7 @@ import ( "context" "database/sql" "reflect" + "time" "github.com/uptrace/bun/schema" ) @@ -45,8 +46,8 @@ func (m *sliceTableModel) init(sliceType reflect.Type) { } } -func (m *sliceTableModel) Join(name string, apply func(*SelectQuery) *SelectQuery) *join { - return m.join(m.slice, name, apply) +func (m *sliceTableModel) Join(name string) *relationJoin { + return m.join(m.slice, name) } func (m *sliceTableModel) Bind(bind reflect.Value) { @@ -100,12 +101,12 @@ var ( _ schema.AfterScanHook = (*sliceTableModel)(nil) ) -func (m *sliceTableModel) updateSoftDeleteField() error { +func (m *sliceTableModel) updateSoftDeleteField(tm time.Time) error { sliceLen := m.slice.Len() for i := 0; i < sliceLen; i++ { strct := indirect(m.slice.Index(i)) fv := m.table.SoftDeleteField.Value(strct) - if err := m.table.UpdateSoftDeleteField(fv); err != nil { + if err := m.table.UpdateSoftDeleteField(fv, tm); err != nil { return err } } |