MCPcopy
hub / github.com/MagicStack/asyncpg / get_attributes

Method get_attributes

asyncpg/prepared_stmt.py:79–101  ·  view source on GitHub ↗

Return a description of relation attributes (columns). :return: A tuple of :class:`asyncpg.types.Attribute`. Example:: st = await self.con.prepare(''' SELECT typname, typnamespace FROM pg_type ''') print(st.get_attributes())

(self)

Source from the content-addressed store, hash-verified

77
78 @connresource.guarded
79 def get_attributes(self):
80 """Return a description of relation attributes (columns).
81
82 :return: A tuple of :class:`asyncpg.types.Attribute`.
83
84 Example::
85
86 st = await self.con.prepare('''
87 SELECT typname, typnamespace FROM pg_type
88 ''')
89 print(st.get_attributes())
90
91 # Will print:
92 # (Attribute(
93 # name='typname',
94 # type=Type(oid=19, name='name', kind='scalar',
95 # schema='pg_catalog')),
96 # Attribute(
97 # name='typnamespace',
98 # type=Type(oid=26, name='oid', kind='scalar',
99 # schema='pg_catalog')))
100 """
101 return self._state._get_attributes()
102
103 @connresource.guarded
104 def cursor(self, *args, prefetch=None,

Callers 6

test_standard_codecsMethod · 0.80
test_compositesMethod · 0.80
test_domainsMethod · 0.80
test_no_resultMethod · 0.80

Calls

no outgoing calls

Tested by 6

test_standard_codecsMethod · 0.64
test_compositesMethod · 0.64
test_domainsMethod · 0.64
test_no_resultMethod · 0.64