|
1 |
| -# Attribute View |
| 1 | +# Attribute View |
| 2 | + |
| 3 | +## **Review Attributes Managed by a Connector** |
| 4 | + |
| 5 | +As a connector completes initial table snapshot, the source tables, columns and data types would have been translated, transformed and created on PostgreSQL side according to the [object mapping rules](https://docs.synchdb.com/user-guide/object_mapping_rules/). SynchDB provides a view that displays a side-by-side view of a connector's data type, name mapping and transform rule relationships between source and destination tables. |
| 6 | + |
| 7 | +This view is informational and it intends to show the user the list of tables a connector currently is tracking and the mapping/transform rules it uses per table/column. |
| 8 | + |
| 9 | +```sql |
| 10 | +SELECT * FROM synchdb_att_view(); |
| 11 | +``` |
| 12 | + |
| 13 | +**Return Fields**: |
| 14 | + |
| 15 | +| Field | Description | Type | |
| 16 | +|-|-|-| |
| 17 | +| `name` | Connector identifier | Text | |
| 18 | +| `attnum` | Attribute number | Integer | |
| 19 | +| `ext_tbname` | table name as appeared remotely | Text | |
| 20 | +| `pg_tbname` | mapped table name in PostgreSQL | Text | |
| 21 | +| `ext_attname` | column name as appeared remotely | Text | |
| 22 | +| `pg_attname` | mapped column name in PostgreSQL | Text | |
| 23 | +| `ext_atttypename` | data type as appeared remotely | Text | |
| 24 | +| `pg_atttypename` | mapped data type in PostgreSQL | Text | |
| 25 | +| `transform` | transform expression | Text | |
| 26 | + |
| 27 | +**Example Output** |
| 28 | + |
| 29 | +```sql |
| 30 | +SELECT * from synchdb_att_view; |
| 31 | + name | type | attnum | ext_tbname | pg_tbname | ext_attname | pg_attname | ext_atttypename | pg_atttypename | transform |
| 32 | +-----------+-------+--------+----------------------------+----------------------------+-------------+-------------+-----------------+----------------+---------------------------- |
| 33 | + mysqlconn | mysql | 1 | inventory.addresses | inventory.addresses | id | id | INT | int4 | |
| 34 | + mysqlconn | mysql | 2 | inventory.addresses | inventory.addresses | customer_id | customer_id | INT | int4 | |
| 35 | + mysqlconn | mysql | 3 | inventory.addresses | inventory.addresses | street | street | VARCHAR | varchar | |
| 36 | + mysqlconn | mysql | 4 | inventory.addresses | inventory.addresses | city | city | VARCHAR | varchar | |
| 37 | + mysqlconn | mysql | 5 | inventory.addresses | inventory.addresses | state | state | VARCHAR | varchar | |
| 38 | + mysqlconn | mysql | 6 | inventory.addresses | inventory.addresses | zip | zip | VARCHAR | varchar | |
| 39 | + mysqlconn | mysql | 7 | inventory.addresses | inventory.addresses | type | type | ENUM | text | |
| 40 | + mysqlconn | mysql | 1 | inventory.customers | schema1.people | id | id | INT | int4 | |
| 41 | + mysqlconn | mysql | 2 | inventory.customers | schema1.people | first_name | first_name | VARCHAR | varchar | |
| 42 | + mysqlconn | mysql | 3 | inventory.customers | schema1.people | last_name | family_name | VARCHAR | varchar | |
| 43 | + mysqlconn | mysql | 4 | inventory.customers | schema1.people | email | contact | VARCHAR | varchar | |
| 44 | + mysqlconn | mysql | 1 | inventory.geom | inventory.geom | id | id | INT | int4 | |
| 45 | + mysqlconn | mysql | 2 | inventory.geom | inventory.geom | g | g | GEOMETRY | geometry | |
| 46 | + mysqlconn | mysql | 3 | inventory.geom | inventory.geom | h | h | GEOMETRY | text | |
| 47 | + mysqlconn | mysql | 1 | inventory.products | public.stuff | id | id | INT | int4 | |
| 48 | + mysqlconn | mysql | 2 | inventory.products | public.stuff | name | name | VARCHAR | varchar | '>>>>>' || '%d' || '<<<<<' |
| 49 | + mysqlconn | mysql | 3 | inventory.products | public.stuff | description | description | VARCHAR | varchar | |
| 50 | + mysqlconn | mysql | 4 | inventory.products | public.stuff | weight | weight | FLOAT | float4 | |
| 51 | + mysqlconn | mysql | 1 | inventory.products_on_hand | inventory.products_on_hand | product_id | product_id | INT | int4 | |
| 52 | + mysqlconn | mysql | 2 | inventory.products_on_hand | inventory.products_on_hand | quantity | quantity | INT | int8 | |
| 53 | +``` |
0 commit comments