MCPcopy
hub / github.com/psycopg/psycopg / get_py_oids

Function get_py_oids

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

Source from the content-addressed store, hash-verified

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

Callers 1

update_python_oidsFunction · 0.85

Calls 2

upperMethod · 0.80
executeMethod · 0.45

Tested by

no test coverage detected