diff options
author | 2024-11-25 15:42:37 +0000 | |
---|---|---|
committer | 2024-11-25 15:42:37 +0000 | |
commit | 3fceb5fc1a83a6ba3ca3c314eef50f0b45cd6009 (patch) | |
tree | d9fd78a82ec2352aad47d50cd9176e150f600b07 /vendor/github.com/uptrace/bun/schema/tables.go | |
parent | [bugfix] notification types missing from link header (#3571) (diff) | |
download | gotosocial-3fceb5fc1a83a6ba3ca3c314eef50f0b45cd6009.tar.xz |
bumps uptrace/bun dependencies to v1.2.6 (#3569)
Diffstat (limited to 'vendor/github.com/uptrace/bun/schema/tables.go')
-rw-r--r-- | vendor/github.com/uptrace/bun/schema/tables.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/vendor/github.com/uptrace/bun/schema/tables.go b/vendor/github.com/uptrace/bun/schema/tables.go index 985093421..58c45cbee 100644 --- a/vendor/github.com/uptrace/bun/schema/tables.go +++ b/vendor/github.com/uptrace/bun/schema/tables.go @@ -77,6 +77,7 @@ func (t *Tables) InProgress(typ reflect.Type) *Table { return table } +// ByModel gets the table by its Go name. func (t *Tables) ByModel(name string) *Table { var found *Table t.tables.Range(func(typ reflect.Type, table *Table) bool { @@ -89,6 +90,7 @@ func (t *Tables) ByModel(name string) *Table { return found } +// ByName gets the table by its SQL name. func (t *Tables) ByName(name string) *Table { var found *Table t.tables.Range(func(typ reflect.Type, table *Table) bool { @@ -100,3 +102,13 @@ func (t *Tables) ByName(name string) *Table { }) return found } + +// All returns all registered tables. +func (t *Tables) All() []*Table { + var found []*Table + t.tables.Range(func(typ reflect.Type, table *Table) bool { + found = append(found, table) + return true + }) + return found +} |