Sqlalchemy Postgres

🌐Community
by cfircoo · vlatest · Repository

Connects to and queries PostgreSQL databases using SQLAlchemy, enabling data retrieval and manipulation via Python code.

Install on your platform

We auto-selected Claude Code based on this skill’s supported platforms.

1

Run in terminal (recommended)

terminal
claude mcp add sqlalchemy-postgres npx -- -y @trustedskills/sqlalchemy-postgres
2

Or manually add to ~/.claude/settings.json

~/.claude/settings.json
{
  "mcpServers": {
    "sqlalchemy-postgres": {
      "command": "npx",
      "args": [
        "-y",
        "@trustedskills/sqlalchemy-postgres"
      ]
    }
  }
}

Requires Claude Code (claude CLI). Run claude --version to verify your install.

About This Skill

The sqlalchemy-postgres skill enables AI agents to interact directly with PostgreSQL databases using the SQLAlchemy ORM. It allows agents to execute raw SQL queries, manage database sessions, and perform CRUD operations on tables defined within a PostgreSQL environment.

When to use it

  • Retrieving specific data records from a PostgreSQL table based on complex filtering criteria.
  • Inserting new rows into a database when an agent processes incoming user submissions or events.
  • Updating existing records in a live production database after analyzing logs or metrics.
  • Deleting obsolete entries from a dataset to maintain data hygiene and reduce storage costs.

Key capabilities

  • SQLAlchemy ORM Integration: Leverages the full power of SQLAlchemy for object-relational mapping with PostgreSQL.
  • Raw SQL Execution: Supports running custom, uncompiled SQL queries for complex logic not easily handled by ORM models.
  • Session Management: Handles database connections and transaction lifecycles automatically to ensure data integrity.
  • PostgreSQL Specifics: Optimized specifically for the PostgreSQL dialect, utilizing its advanced features like JSONB and full-text search.

Example prompts

  • "Query the users table in my PostgreSQL database to find all accounts created in the last 30 days."
  • "Insert a new row into the orders table with the customer ID 'C123', amount 50.00, and status 'pending'."
  • "Update the inventory_count column for product ID 'P999' to reflect the latest stock level from my warehouse system."

Tips & gotchas

Ensure your PostgreSQL database is running and accessible before attempting to connect; the skill will fail silently if connection parameters are incorrect. Always validate that the target tables exist in the specified schema, as SQLAlchemy cannot auto-discover remote table structures without explicit configuration.

Tags

🛡️

TrustedSkills Verification

Unlike other registries that point to live repositories, TrustedSkills pins every skill to a verified commit hash. This protects you from malicious updates — what you install today is exactly what was reviewed and verified.

Security Audits

Gen Agent Trust HubPass
SocketPass
SnykPass

Details

Version
vlatest
License
Author
cfircoo
Installs
86

🌐 Community

Passed automated security scans.