PostgreSQL

PostgreSQL é um sistema de banco de dados relacional open-source amplamente utilizado, conhecido por confiabilidade, extensibilidade e conformidade com padrões. Ele armazena dados estruturados em tabelas e oferece suporte a SQL para consultas, transações e gerenciamento de schema.

Com esta integração, você pode:

  • Consultar dados: Execute instruções SELECT para recuperar linhas de um banco de dados
  • Inserir, atualizar e excluir dados: Escreva, modifique e remova linhas em uma tabela
  • Executar SQL bruto: Execute instruções SQL arbitrárias diretamente no banco de dados
  • Introspectar schemas: Recupere estruturas de tabelas, colunas, chaves primárias/estrangeiras e índices

No Zoen, a integração com o PostgreSQL permite que seus agentes se conectem a um banco de dados PostgreSQL e consultem, insiram, atualizem, excluam e executem SQL bruto nele, além de introspectar o schema do banco para descobrir tabelas, colunas e relacionamentos. Isso dá aos seus agentes a capacidade de ler e escrever dados estruturados como parte de um workflow, e de compreender a estrutura de um banco de dados antes de gerar ou executar consultas nele.

Usage Instructions

Integrate PostgreSQL into the workflow. Can query, insert, update, delete, and execute raw SQL.

Actions

postgresql_query

Execute a SELECT query on PostgreSQL database

Input

ParameterTypeRequiredDescription
hoststringYesPostgreSQL server hostname or IP address
portnumberYesPostgreSQL server port (default: 5432)
databasestringYesDatabase name to connect to
usernamestringYesDatabase username
passwordstringYesDatabase password
sslstringNoSSL connection mode (disabled, required, preferred)
querystringYesSQL SELECT query to execute

Output

ParameterTypeDescription
messagestringOperation status message
rowsarrayArray of rows returned from the query
rowCountnumberNumber of rows returned

postgresql_insert

Insert data into PostgreSQL database

Input

ParameterTypeRequiredDescription
hoststringYesPostgreSQL server hostname or IP address
portnumberYesPostgreSQL server port (default: 5432)
databasestringYesDatabase name to connect to
usernamestringYesDatabase username
passwordstringYesDatabase password
sslstringNoSSL connection mode (disabled, required, preferred)
tablestringYesTable name to insert data into
dataobjectYesData object to insert (key-value pairs)

Output

ParameterTypeDescription
messagestringOperation status message
rowsarrayInserted data (if RETURNING clause used)
rowCountnumberNumber of rows inserted

postgresql_update

Update data in PostgreSQL database

Input

ParameterTypeRequiredDescription
hoststringYesPostgreSQL server hostname or IP address
portnumberYesPostgreSQL server port (default: 5432)
databasestringYesDatabase name to connect to
usernamestringYesDatabase username
passwordstringYesDatabase password
sslstringNoSSL connection mode (disabled, required, preferred)
tablestringYesTable name to update data in
dataobjectYesData object with fields to update (key-value pairs)
wherestringYesWHERE clause condition (without WHERE keyword)

Output

ParameterTypeDescription
messagestringOperation status message
rowsarrayUpdated data (if RETURNING clause used)
rowCountnumberNumber of rows updated

postgresql_delete

Delete data from PostgreSQL database

Input

ParameterTypeRequiredDescription
hoststringYesPostgreSQL server hostname or IP address
portnumberYesPostgreSQL server port (default: 5432)
databasestringYesDatabase name to connect to
usernamestringYesDatabase username
passwordstringYesDatabase password
sslstringNoSSL connection mode (disabled, required, preferred)
tablestringYesTable name to delete data from
wherestringYesWHERE clause condition (without WHERE keyword)

Output

ParameterTypeDescription
messagestringOperation status message
rowsarrayDeleted data (if RETURNING clause used)
rowCountnumberNumber of rows deleted

postgresql_execute

Execute raw SQL query on PostgreSQL database

Input

ParameterTypeRequiredDescription
hoststringYesPostgreSQL server hostname or IP address
portnumberYesPostgreSQL server port (default: 5432)
databasestringYesDatabase name to connect to
usernamestringYesDatabase username
passwordstringYesDatabase password
sslstringNoSSL connection mode (disabled, required, preferred)
querystringYesRaw SQL query to execute

Output

ParameterTypeDescription
messagestringOperation status message
rowsarrayArray of rows returned from the query
rowCountnumberNumber of rows affected

postgresql_introspect

Introspect PostgreSQL database schema to retrieve table structures, columns, and relationships

Input

ParameterTypeRequiredDescription
hoststringYesPostgreSQL server hostname or IP address
portnumberYesPostgreSQL server port (default: 5432)
databasestringYesDatabase name to connect to
usernamestringYesDatabase username
passwordstringYesDatabase password
sslstringNoSSL connection mode (disabled, required, preferred)
schemastringNoSchema to introspect (default: public)

Output

ParameterTypeDescription
messagestringOperation status message
tablesarrayArray of table schemas with columns, keys, and indexes
namestringTable name
schemastringSchema name (e.g., public)
columnsarrayTable columns
namestringColumn name
typestringData type (e.g., integer, varchar, timestamp)
nullablebooleanWhether the column allows NULL values
defaultstringDefault value expression
isPrimaryKeybooleanWhether the column is part of the primary key
isForeignKeybooleanWhether the column is a foreign key
referencesobjectForeign key reference information
tablestringReferenced table name
columnstringReferenced column name
primaryKeyarrayPrimary key column names
foreignKeysarrayForeign key constraints
columnstringLocal column name
referencesTablestringReferenced table name
referencesColumnstringReferenced column name
indexesarrayTable indexes
namestringIndex name
columnsarrayColumns included in the index
uniquebooleanWhether the index enforces uniqueness
schemasarrayList of available schemas in the database

On this page