MCPcopy
hub / github.com/psycopg/psycopg / get_cython_oids

Function get_cython_oids

tools/update_oids.py:213–227  ·  view source on GitHub ↗
(conn: Connection)

Source from the content-addressed store, hash-verified

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

Callers 1

update_cython_oidsFunction · 0.85

Calls 2

upperMethod · 0.80
executeMethod · 0.45

Tested by

no test coverage detected