PostgreSQL
连接到 PostgreSQL 数据库
配置
查询(SELECT)
操作
查询(SELECT)
主机*
localhost 或 your.database.host
端口*
5432
数据库名*
your_database
用户名*
postgres
密码*
••••••••
SSL 模式
首选
SQL 查询*
sql
SELECT * FROM users WHERE active = true
查询(SELECT)(
postgresql_query)在 PostgreSQL 数据库上执行 SELECT 查询
输入
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
host | string | 是 | PostgreSQL 服务器主机名或 IP 地址 |
port | number | 是 | PostgreSQL 服务器端口 (默认:5432) |
database | string | 是 | 要连接的数据库名称 |
username | string | 是 | 数据库用户名 |
password | string | 是 | 数据库密码 |
ssl | string | 否 | SSL 连接模式 (disabled、required、preferred) |
query | string | 是 | 要执行的 SQL SELECT 查询 |
输出
| 参数 | 类型 | 说明 |
|---|---|---|
message | string | 操作状态消息 |
rows | array | 查询返回的行数组 |
rowCount | number | 返回的行数 |
插入数据
操作
插入数据
主机*
localhost 或 your.database.host
端口*
5432
数据库名称*
your_database
用户名*
postgres
密码*
••••••••
SSL 模式
首选
表名*
users
数据(JSON)*
json
{
"name": "John Doe",
"email": "john@example.com",
"active": true
}
插入数据 (
postgresql_insert)向 PostgreSQL 数据库插入数据
输入
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
host | string | 是 | PostgreSQL 服务器主机名或 IP 地址 |
port | number | 是 | PostgreSQL 服务器端口 (默认:5432) |
database | string | 是 | 要连接的数据库名称 |
username | string | 是 | 数据库用户名 |
password | string | 是 | 数据库密码 |
ssl | string | 否 | SSL 连接模式 (disabled、required、preferred) |
table | string | 是 | 要插入数据的表名 |
data | object | 是 | 要插入的数据对象 (键值对) |
输出
| 参数 | 类型 | 说明 |
|---|---|---|
message | string | 操作状态消息 |
rows | array | 插入的数据 (如果使用了 RETURNING 子句) |
rowCount | number | 插入的行数 |
更新数据
操作
更新数据
主机*
localhost 或 your.database.host
端口*
5432
数据库名称*
your_database
用户名*
postgres
密码*
••••••••
SSL 模式
首选
表名*
users
更新数据 (JSON)*
json
{
"name": "Jane Doe",
"email": "jane@example.com"
}
WHERE 条件*
id = 1
更新数据(
postgresql_update)更新 PostgreSQL 数据库中的数据
输入
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
host | string | 是 | PostgreSQL 服务器主机名或 IP 地址 |
port | number | 是 | PostgreSQL 服务器端口(默认:5432) |
database | string | 是 | 要连接的数据库名称 |
username | string | 是 | 数据库用户名 |
password | string | 是 | 数据库密码 |
ssl | string | 否 | SSL 连接模式(disabled、required、preferred) |
table | string | 是 | 要更新数据的表名 |
data | object | 是 | 包含待更新字段的数据对象(键值对) |
where | string | 是 | WHERE 子句条件(不含 WHERE 关键字) |
输出
| 参数 | 类型 | 说明 |
|---|---|---|
message | string | 操作状态消息 |
rows | array | 更新后的数据(如果使用了 RETURNING 子句) |
rowCount | number | 已更新的行数 |
删除数据
操作
删除数据
主机*
localhost 或 your.database.host
端口*
5432
数据库名称*
your_database
用户名*
postgres
密码*
••••••••
SSL 模式
首选
表名*
users
WHERE 条件*
id = 1
删除数据 (
postgresql_delete)从 PostgreSQL 数据库删除数据
输入
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
host | string | 是 | PostgreSQL 服务器主机名或 IP 地址 |
port | number | 是 | PostgreSQL 服务器端口(默认:5432) |
database | string | 是 | 要连接的数据库名称 |
username | string | 是 | 数据库用户名 |
password | string | 是 | 数据库密码 |
ssl | string | 否 | SSL 连接模式(disabled、required、preferred) |
table | string | 是 | 要从中删除数据的表名 |
where | string | 是 | WHERE 子句条件(不含 WHERE 关键字) |
输出
| 参数 | 类型 | 说明 |
|---|---|---|
message | string | 操作状态消息 |
rows | array | 已删除的数据(如果使用了 RETURNING 子句) |
rowCount | number | 已删除的行数 |
执行原始 SQL
操作
执行原始 SQL
主机*
localhost 或 your.database.host
端口*
5432
数据库名称*
your_database
用户名*
postgres
密码*
••••••••
SSL 模式
首选
SQL 查询*
sql
SELECT * FROM table_name
执行原始 SQL(
postgresql_execute)在 PostgreSQL 数据库上执行原始 SQL 查询
输入
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
host | string | 是 | PostgreSQL 服务器主机名或 IP 地址 |
port | number | 是 | PostgreSQL 服务器端口(默认:5432) |
database | string | 是 | 要连接的数据库名称 |
username | string | 是 | 数据库用户名 |
password | string | 是 | 数据库密码 |
ssl | string | 否 | SSL 连接模式(disabled、required、preferred) |
query | string | 是 | 要执行的原始 SQL 查询 |
输出
| 参数 | 类型 | 说明 |
|---|---|---|
message | string | 操作状态消息 |
rows | array | 查询返回的行数组 |
rowCount | number | 受影响的行数 |
使用说明
将 PostgreSQL 集成到工作流中。可查询、插入、更新、删除并执行原始 SQL。
备注
- 类别:
tools - 类型:
postgresql