| 72 | return [Completion(text=k, start_position=pos, display_meta=v.description) for k, v in self.completer.pgspecial.commands.items()] |
| 73 | |
| 74 | def columns(self, tbl, parent="public", typ="tables", pos=0): |
| 75 | if typ == "functions": |
| 76 | fun = [x for x in self.metadata[typ][parent] if x[0] == tbl][0] |
| 77 | cols = fun[1] |
| 78 | else: |
| 79 | cols = self.metadata[typ][parent][tbl] |
| 80 | return [column(escape(col), pos) for col in cols] |
| 81 | |
| 82 | def datatypes(self, parent="public", pos=0): |
| 83 | return [datatype(escape(x), pos) for x in self.metadata.get("datatypes", {}).get(parent, [])] |