37ec4b250dd88500cc881950dcb19509665b6a0a
[mdref/mdref-pq-gateway] / Attributes.md
1 # class pq\Gateway\Table\Attributes implements IteratorAggregate
2
3 The table attributes (columns) of a table.
4
5 ## Query:
6
7 The following query is executed by the current executor of the table to retrieve the table attributes:
8
9 select
10 attnum as index
11 ,attname as name
12 ,atttypid as type
13 ,atthasdef as hasdefault
14 ,not attnotnull as nullable
15 from
16 pg_attribute
17 where attrelid = \$1::regclass
18 and attnum > 0
19
20 ## Cache:
21
22 The result of this query is cached in the metadata cache under the following key, where $table is converted to a string by pq\Gateway\Table::__toString():
23
24 "$table:attributes"
25
26 ## Properties:
27
28 * protected array $columns
29 The table attributes.
30