Skip to main content
PostgreSQL logo

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

FieldDescriptionRequiredFormat
HostPostgreSQL server hostname or IPYeslocalhost or postgres.example.com
PortPostgreSQL server port (defaults to 5432 if omitted)No5432
UsernamePostgreSQL username for authenticationYes-
PasswordPostgreSQL password for authenticationYes-
DatabaseThe database name to connect toYes-
SSL ModeSSL mode: ‘disabled’, ‘verify’ (default — full verify), or ‘skip_verification’ (encrypted but no cert check)No`verifyskip_verificationdisabled`

Available Actions

Parameters

sql
string
required
The SQL to execute
values
array
Values for 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"
}

Parameters

table
string
required
The table name
data
object
required
Column-value pairs to insert
schema_name
string
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"
}

Parameters

table
string
required
The table name
condition
string
required
WHERE condition with ’?’ placeholders
values
array
required
Values matching the ’?’ placeholders in the condition
schema_name
string
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"
}

Parameters

table
string
required
The table name
data
object
required
Column-value pairs to update
condition
string
required
WHERE condition with ’?’ placeholders
condition_values
array
required
Values matching the ’?’ placeholders
schema_name
string
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"
}

Parameters

table
string
required
The table name
data
object
required
Column-value pairs to insert/update
conflict_target
string
required
Column to use for conflict detection (usually PK)
schema_name
string
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"
}

Parameters

table
string
required
The table name
column
string
required
The column to filter by
operator
string
Comparison operator (=, >, >=, <, !=, <=, LIKE, ILIKE) (Default: =)
value
string
Value to compare against (typed dynamically)
schema_name
string
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"
}

Parameters

table
string
required
The table name
condition
string
required
WHERE condition with ’?’ placeholders
values
array
required
Values matching the ’?’ placeholders in the condition
schema_name
string
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"
}

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"
}

Parameters

schema_name
string
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"
}

Parameters

table
string
required
The table name
schema_name
string
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"
    },
    "columns": {
      "items": {
        "additionalProperties": true,
        "type": "object"
      },
      "title": "Columns",
      "type": "array"
    },
    "column_count": {
      "default": 0,
      "title": "Column Count",
      "type": "integer"
    },
    "primary_keys": {
      "items": {
        "type": "string"
      },
      "title": "Primary Keys",
      "type": "array"
    }
  },
  "required": [
    "success"
  ],
  "title": "DescribeTableOutput",
  "type": "object"
}

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.

MySQL

Snowflake

Supabase