@@ -14,18 +14,30 @@ Teable allows you to connect to its underlying PostgreSQL database through exter
14141 . ** Open a Table** : First, open any table within the base you want to connect to.
15152 . ** Enter Design Page** : Click the ⚙️ icon in the top right corner to enter the Base Design page.
1616
17- ![ ] ( /images/2025-12-05-01-16-08.png )
17+ <img
18+ src = " /images/api/sql-query/2026-05-29-sql-query-open-design-page-en.png"
19+ alt = " Open the Base Design page"
20+ className = " docs-screenshot"
21+ />
1822
19233 . ** Find Database Connection Panel** : In the Design page, locate the "Database Connection" panel.
20244 . ** Create Connection** : Click create, and the system will automatically generate a read-only PostgreSQL connection with username, password, and host address.
2125
22- ![ ] ( /images/2025-12-05-01-17-53.png )
26+ <img
27+ src = " /images/api/sql-query/2026-05-29-sql-query-database-connection-panel-en.png"
28+ alt = " Database Connection panel"
29+ className = " docs-screenshot"
30+ />
2331
2432### Connecting to the Database
2533
2634Use the credentials to connect through your preferred tool. Here's an example:
2735
28- <img alt = " Connection example" src = " /images/kai-fa-zhe/ceef01dd644628f4.png" />
36+ <img
37+ src = " /images/api/sql-query/2026-05-29-sql-query-connection-example.png"
38+ alt = " External database connection example"
39+ className = " docs-screenshot"
40+ />
2941
3042### Querying Data
3143
@@ -50,25 +62,41 @@ Each Base in Teable corresponds to a **schema** in PostgreSQL. The BaseId is the
5062
5163** Method 1:** Look at the URL - the string starting with ` bse ` is the BaseId.
5264
53- <img alt = " baseId" src = " /images/kai-fa-zhe/e8ef17c59ac0c067.png" />
65+ <img
66+ src = " /images/api/sql-query/2026-05-29-sql-query-base-id-url.png"
67+ alt = " Base ID in the URL"
68+ className = " docs-screenshot"
69+ />
5470
5571** Method 2:** In the Base Design interface, the schema name shown is the BaseId.
5672
57- <img alt = " Design page" src = " /images/kai-fa-zhe/64fbddbd0f5519c4.png" />
73+ <img
74+ src = " /images/api/sql-query/2026-05-29-sql-query-design-page-schema.png"
75+ alt = " Schema name in the Base Design page"
76+ className = " docs-screenshot"
77+ />
5878
5979### Finding Table Names
6080
6181Table names in Teable interface don't automatically sync with physical database table names. Check the Base Design Interface for the actual database table name.
6282
63- <img alt = " table info" src = " /images/kai-fa-zhe/ba2fdb846b2062ce.png" />
83+ <img
84+ src = " /images/api/sql-query/2026-05-29-sql-query-table-info.png"
85+ alt = " Physical table name in the design page"
86+ className = " docs-screenshot"
87+ />
6488
6589** Tip:** You can modify the physical table name in the design interface if needed.
6690
6791### Finding Field Names
6892
6993Field (column) names in the database may differ from the Teable interface. Check the ` dbFieldName ` in the design interface.
7094
71- <img alt = " db field name" src = " /images/kai-fa-zhe/7609033391e8e7c1.png" />
95+ <img
96+ src = " /images/api/sql-query/2026-05-29-sql-query-db-field-name.png"
97+ alt = " DB field name in the design page"
98+ className = " docs-screenshot"
99+ />
72100
73101** Tip:** Changing field names in Teable won't sync automatically. Modify ` dbFieldName ` explicitly to change the actual column name in PostgreSQL.
74102
@@ -98,7 +126,11 @@ The database connection is scoped to the current base only. PostgreSQL schemas p
98126
99127You may see other baseIds (schema names) when connecting, but you cannot access their content.
100128
101- <img alt = " base id in TablePlus" src = " /images/kai-fa-zhe/093aebb4bc8cf732.png" />
129+ <img
130+ src = " /images/api/sql-query/2026-05-29-sql-query-tableplus-base-id.png"
131+ alt = " Base ID in TablePlus"
132+ className = " docs-screenshot"
133+ />
102134
103135### Connection Limits
104136
0 commit comments