MCPcopy
hub / github.com/psycopg/psycopg / get_py_ranges

Function get_py_ranges

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

Source from the content-addressed store, hash-verified

172
173
174def get_py_ranges(conn: Connection) -> list[str]:
175 lines = []
176 for typname, oid, typarray, rngsubtype in conn.execute("""
177select typname, oid, typarray, rngsubtype
178from
179 pg_type t
180 join pg_range r on t.oid = rngtypid
181where
182 oid < 10000
183 and typtype = 'r'
184order by typname
185"""):
186 params = [f"{typname!r}, {oid}, {typarray}, subtype_oid={rngsubtype}"]
187 lines.append(f"RangeInfo({','.join(params)}),")
188
189 return lines
190
191
192def get_py_multiranges(conn: Connection) -> list[str]:

Callers 1

update_python_typesFunction · 0.85

Calls 2

executeMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected