(conn: Connection)
| 190 | |
| 191 | |
| 192 | def get_py_multiranges(conn: Connection) -> list[str]: |
| 193 | lines = [] |
| 194 | for typname, oid, typarray, rngtypid, rngsubtype in conn.execute(""" |
| 195 | select typname, oid, typarray, rngtypid, rngsubtype |
| 196 | from |
| 197 | pg_type t |
| 198 | join pg_range r on t.oid = rngmultitypid |
| 199 | where |
| 200 | oid < 10000 |
| 201 | and typtype = 'm' |
| 202 | order by typname |
| 203 | """): |
| 204 | params = [ |
| 205 | f"{typname!r}, {oid}, {typarray}," |
| 206 | f" range_oid={rngtypid}, subtype_oid={rngsubtype}" |
| 207 | ] |
| 208 | lines.append(f"MultirangeInfo({','.join(params)}),") |
| 209 | |
| 210 | return lines |
| 211 | |
| 212 | |
| 213 | def get_cython_oids(conn: Connection) -> list[str]: |
no test coverage detected