MCPcopy Index your code
hub / github.com/upper/db / Collections

Method Collections

adapter/postgresql/database.go:44–65  ·  view source on GitHub ↗
(sess sqladapter.Session)

Source from the content-addressed store, hash-verified

42}
43
44func (*database) Collections(sess sqladapter.Session) (collections []string, err error) {
45 q := sess.SQL().
46 Select("table_name").
47 From("information_schema.tables").
48 Where("table_schema = ?", "public")
49
50 iter := q.Iterator()
51 defer iter.Close()
52
53 for iter.Next() {
54 var name string
55 if err := iter.Scan(&name); err != nil {
56 return nil, err
57 }
58 collections = append(collections, name)
59 }
60 if err := iter.Err(); err != nil {
61 return nil, err
62 }
63
64 return collections, nil
65}
66
67func (*database) ConvertValue(in interface{}) interface{} {
68 switch v := in.(type) {

Callers

nothing calls this directly

Calls 9

WhereMethod · 0.65
FromMethod · 0.65
SelectMethod · 0.65
SQLMethod · 0.65
IteratorMethod · 0.65
CloseMethod · 0.65
NextMethod · 0.65
ScanMethod · 0.65
ErrMethod · 0.65

Tested by

no test coverage detected