(conn: Connection)
| 101 | |
| 102 | |
| 103 | def get_py_oids(conn: Connection) -> list[str]: |
| 104 | lines = [] |
| 105 | for typname, oid in conn.execute(""" |
| 106 | select typname, oid |
| 107 | from pg_type |
| 108 | where |
| 109 | oid < 10000 |
| 110 | and (typtype = any('{b,r,m}') or typname = 'record') |
| 111 | and (typname !~ '^(_|pg_)' or typname = 'pg_lsn') |
| 112 | order by typname |
| 113 | """): |
| 114 | const_name = typname.upper() + "_OID" |
| 115 | lines.append(f"{const_name} = {oid}") |
| 116 | |
| 117 | return lines |
| 118 | |
| 119 | |
| 120 | typemods = { |
no test coverage detected