Returns a list of output-field ColumnMetadata namedtuples
(self)
| 139 | return [arg(name, typ, num) for num, (name, typ) in enumerate(args)] |
| 140 | |
| 141 | def fields(self): |
| 142 | """Returns a list of output-field ColumnMetadata namedtuples""" |
| 143 | |
| 144 | if self.return_type.lower() == 'void': |
| 145 | return [] |
| 146 | if not self.arg_modes: |
| 147 | # For functions without output parameters, the function name |
| 148 | # is used as the name of the output column. |
| 149 | # E.g. 'SELECT unnest FROM unnest(...);' |
| 150 | return [ColumnMetadata(self.func_name, self.return_type, [])] |
| 151 | |
| 152 | return [ColumnMetadata(name, typ, []) |
| 153 | for name, typ, mode in zip( |
| 154 | self.arg_names, self.arg_types, self.arg_modes) |
| 155 | if mode in ('o', 'b', 't')] # OUT, INOUT, TABLE |
no test coverage detected