Overview
Add PostgreSQL to any ModuleX agent or workflow. PostgreSQL database integration via the asyncpg driver. Provides raw SQL execution + CRUD + upsert + introspection.
Categories : Databases · Database · Data Management · Storage · Auth : PostgreSQL Database Credentials · Actions : 10
Authentication
PostgreSQL Database Credentials
Authenticate using PostgreSQL connection credentials (host/port/user/password/database).
Required Credentials
Field Description Required Format Host PostgreSQL server hostname or IP Yes localhost or postgres.example.comPort PostgreSQL server port (defaults to 5432 if omitted) No 5432Username PostgreSQL username for authentication Yes -Password PostgreSQL password for authentication Yes -Database The database name to connect to Yes -SSL Mode SSL mode: ‘disabled’, ‘verify’ (default — full verify), or ‘skip_verification’ (encrypted but no cert check) No `verify skip_verification disabled`
Available Actions
execute_raw_query — Execute a raw SQL statement (SELECT/INSERT/UPDATE/DELETE/DDL). Use $1, $2, ... placeholders for parameterized queries.
Parameters Values for 1 , 1, 1 , 2, … placeholders Response {
"additionalProperties" : false ,
"properties" : {
"success" : {
"title" : "Success" ,
"type" : "boolean"
},
"error" : {
"anyOf" : [
{
"type" : "string"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Error"
},
"row_count" : {
"anyOf" : [
{
"type" : "integer"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Row Count"
},
"data" : {
"anyOf" : [
{
"items" : {
"additionalProperties" : true ,
"type" : "object"
},
"type" : "array"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Data"
},
"status" : {
"anyOf" : [
{
"type" : "string"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Status"
},
"affected_rows" : {
"anyOf" : [
{
"type" : "integer"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Affected Rows"
}
},
"required" : [
"success"
],
"title" : "ExecuteRawQueryOutput" ,
"type" : "object"
}
create_row — INSERT a new row, returning the inserted record
Parameters Column-value pairs to insert
The schema name (default ‘public’) (Default: public)
Response {
"additionalProperties" : false ,
"properties" : {
"success" : {
"title" : "Success" ,
"type" : "boolean"
},
"error" : {
"anyOf" : [
{
"type" : "string"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Error"
},
"table" : {
"anyOf" : [
{
"type" : "string"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Table"
},
"schema_name" : {
"anyOf" : [
{
"type" : "string"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Schema Name"
},
"inserted_row" : {
"anyOf" : [
{
"additionalProperties" : true ,
"type" : "object"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Inserted Row"
},
"columns" : {
"anyOf" : [
{
"items" : {
"type" : "string"
},
"type" : "array"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Columns"
}
},
"required" : [
"success"
],
"title" : "CreateRowOutput" ,
"type" : "object"
}
delete_row — DELETE rows matching a WHERE condition (returns deleted rows)
Parameters WHERE condition with ’?’ placeholders
Values matching the ’?’ placeholders in the condition
The schema name (default ‘public’) (Default: public)
Response {
"additionalProperties" : false ,
"properties" : {
"success" : {
"title" : "Success" ,
"type" : "boolean"
},
"error" : {
"anyOf" : [
{
"type" : "string"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Error"
},
"table" : {
"anyOf" : [
{
"type" : "string"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Table"
},
"schema_name" : {
"anyOf" : [
{
"type" : "string"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Schema Name"
},
"affected_rows" : {
"default" : 0 ,
"title" : "Affected Rows" ,
"type" : "integer"
},
"deleted_rows" : {
"items" : {
"additionalProperties" : true ,
"type" : "object"
},
"title" : "Deleted Rows" ,
"type" : "array"
}
},
"required" : [
"success"
],
"title" : "DeleteRowOutput" ,
"type" : "object"
}
update_row — UPDATE rows matching a WHERE condition (returns updated rows)
Parameters Column-value pairs to update
WHERE condition with ’?’ placeholders
Values matching the ’?’ placeholders
The schema name (default ‘public’) (Default: public)
Response {
"additionalProperties" : false ,
"properties" : {
"success" : {
"title" : "Success" ,
"type" : "boolean"
},
"error" : {
"anyOf" : [
{
"type" : "string"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Error"
},
"table" : {
"anyOf" : [
{
"type" : "string"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Table"
},
"schema_name" : {
"anyOf" : [
{
"type" : "string"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Schema Name"
},
"affected_rows" : {
"default" : 0 ,
"title" : "Affected Rows" ,
"type" : "integer"
},
"updated_columns" : {
"items" : {
"type" : "string"
},
"title" : "Updated Columns" ,
"type" : "array"
},
"updated_rows" : {
"items" : {
"additionalProperties" : true ,
"type" : "object"
},
"title" : "Updated Rows" ,
"type" : "array"
}
},
"required" : [
"success"
],
"title" : "UpdateRowOutput" ,
"type" : "object"
}
upsert_row — INSERT … ON CONFLICT (conflict_target) DO UPDATE …
Parameters Column-value pairs to insert/update
Column to use for conflict detection (usually PK)
The schema name (default ‘public’) (Default: public)
Response {
"additionalProperties" : false ,
"properties" : {
"success" : {
"title" : "Success" ,
"type" : "boolean"
},
"error" : {
"anyOf" : [
{
"type" : "string"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Error"
},
"table" : {
"anyOf" : [
{
"type" : "string"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Table"
},
"schema_name" : {
"anyOf" : [
{
"type" : "string"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Schema Name"
},
"upserted_row" : {
"anyOf" : [
{
"additionalProperties" : true ,
"type" : "object"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Upserted Row"
},
"conflict_target" : {
"anyOf" : [
{
"type" : "string"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Conflict Target"
}
},
"required" : [
"success"
],
"title" : "UpsertRowOutput" ,
"type" : "object"
}
find_row — SELECT * FROM table WHERE column <op> value
Parameters Comparison operator (=, >, >=, <, !=, <=, LIKE, ILIKE) (Default: =)
Value to compare against (typed dynamically)
The schema name (default ‘public’) (Default: public)
Response {
"additionalProperties" : false ,
"properties" : {
"success" : {
"title" : "Success" ,
"type" : "boolean"
},
"error" : {
"anyOf" : [
{
"type" : "string"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Error"
},
"table" : {
"anyOf" : [
{
"type" : "string"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Table"
},
"schema_name" : {
"anyOf" : [
{
"type" : "string"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Schema Name"
},
"row_count" : {
"default" : 0 ,
"title" : "Row Count" ,
"type" : "integer"
},
"data" : {
"items" : {
"additionalProperties" : true ,
"type" : "object"
},
"title" : "Data" ,
"type" : "array"
}
},
"required" : [
"success"
],
"title" : "FindRowOutput" ,
"type" : "object"
}
execute_query_with_condition — SELECT * FROM table WHERE <condition>
Parameters WHERE condition with ’?’ placeholders
Values matching the ’?’ placeholders in the condition
The schema name (default ‘public’) (Default: public)
Response {
"additionalProperties" : false ,
"properties" : {
"success" : {
"title" : "Success" ,
"type" : "boolean"
},
"error" : {
"anyOf" : [
{
"type" : "string"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Error"
},
"table" : {
"anyOf" : [
{
"type" : "string"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Table"
},
"schema_name" : {
"anyOf" : [
{
"type" : "string"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Schema Name"
},
"row_count" : {
"default" : 0 ,
"title" : "Row Count" ,
"type" : "integer"
},
"data" : {
"items" : {
"additionalProperties" : true ,
"type" : "object"
},
"title" : "Data" ,
"type" : "array"
}
},
"required" : [
"success"
],
"title" : "ExecuteQueryWithConditionOutput" ,
"type" : "object"
}
list_schemas — List all user-visible schemas (excludes pg_catalog etc.)
Response {
"additionalProperties" : false ,
"properties" : {
"success" : {
"title" : "Success" ,
"type" : "boolean"
},
"error" : {
"anyOf" : [
{
"type" : "string"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Error"
},
"schemas" : {
"items" : {
"type" : "string"
},
"title" : "Schemas" ,
"type" : "array"
},
"count" : {
"default" : 0 ,
"title" : "Count" ,
"type" : "integer"
}
},
"required" : [
"success"
],
"title" : "ListSchemasOutput" ,
"type" : "object"
}
list_tables — List all tables and views in a schema
Parameters The schema name (default ‘public’) (Default: public)
Response {
"$defs" : {
"TableEntry" : {
"additionalProperties" : false ,
"properties" : {
"name" : {
"anyOf" : [
{
"type" : "string"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Name"
},
"type" : {
"anyOf" : [
{
"type" : "string"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Type"
}
},
"title" : "TableEntry" ,
"type" : "object"
}
},
"additionalProperties" : false ,
"properties" : {
"success" : {
"title" : "Success" ,
"type" : "boolean"
},
"error" : {
"anyOf" : [
{
"type" : "string"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Error"
},
"schema_name" : {
"anyOf" : [
{
"type" : "string"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Schema Name"
},
"tables" : {
"items" : {
"$ref" : "#/$defs/TableEntry"
},
"title" : "Tables" ,
"type" : "array"
},
"count" : {
"default" : 0 ,
"title" : "Count" ,
"type" : "integer"
}
},
"required" : [
"success"
],
"title" : "ListTablesOutput" ,
"type" : "object"
}
describe_table — Return column metadata + primary keys for a table
Limits & Quotas
60s connection timeout.
find_row operator allowlist: =, >, >=, <, !=, <=,
LIKE, ILIKE (case-insensitive accepted as like/ilike too).
asyncpg is imported lazily so the manifest can be inspected
even without the driver installed.
Links