(conn: Connection)
| 172 | |
| 173 | |
| 174 | def get_py_ranges(conn: Connection) -> list[str]: |
| 175 | lines = [] |
| 176 | for typname, oid, typarray, rngsubtype in conn.execute(""" |
| 177 | select typname, oid, typarray, rngsubtype |
| 178 | from |
| 179 | pg_type t |
| 180 | join pg_range r on t.oid = rngtypid |
| 181 | where |
| 182 | oid < 10000 |
| 183 | and typtype = 'r' |
| 184 | order by typname |
| 185 | """): |
| 186 | params = [f"{typname!r}, {oid}, {typarray}, subtype_oid={rngsubtype}"] |
| 187 | lines.append(f"RangeInfo({','.join(params)}),") |
| 188 | |
| 189 | return lines |
| 190 | |
| 191 | |
| 192 | def get_py_multiranges(conn: Connection) -> list[str]: |
no test coverage detected