(conn: Connection)
| 211 | |
| 212 | |
| 213 | def get_cython_oids(conn: Connection) -> list[str]: |
| 214 | lines = [] |
| 215 | for typname, oid in conn.execute(""" |
| 216 | select typname, oid |
| 217 | from pg_type |
| 218 | where |
| 219 | oid < 10000 |
| 220 | and (typtype = any('{b,r,m}') or typname = 'record') |
| 221 | and (typname !~ '^(_|pg_)' or typname = 'pg_lsn') |
| 222 | order by typname |
| 223 | """): |
| 224 | const_name = typname.upper() + "_OID" |
| 225 | lines.append(f" {const_name} = {oid}") |
| 226 | |
| 227 | return lines |
| 228 | |
| 229 | |
| 230 | def update_file(fn: Path, new: list[str]) -> None: |
no test coverage detected